|
Post by Admin on Apr 3, 2018 8:48:25 GMT -5
Since we are lite on content I will post this Compendium of games we pulled together recently. They are self contained, they run but are not complete. Great to see improvements or other classic games posted here. Games.zip (44.87 KB) -Rod
|
|
|
Post by Carl Gundel on Apr 3, 2018 9:01:10 GMT -5
Since we are lite on content I will post this Compendium of games we pulled together recently. They are self contained, they run but are not complete. Great to see improvements or other classic games posted here. Nice. Here is the list of games in the file you posted. BlackJack.bas BlockOla.bas BlockOlaSound.bas BreakOut.bas Connect4.bas Eliza.bas FighterAce.bas Gems.bas Hangman.bas Lander.bas MasterMind.bas MineSweeper.bas MissileDefense.bas PacMan.bas SeaBattle.bas SudokuMaster.bas Tetris.bas
|
|
|
Post by Mark Dunham on Apr 3, 2018 13:47:59 GMT -5
Since we are lite on content I will post this Compendium of games we pulled together recently. They are self contained, they run but are not complete. Great to see improvements or other classic games posted here. Great reference point for programming ideas. Thanks for posting it.
|
|
Larry
New Member
Posts: 40
|
Post by Larry on Apr 4, 2018 11:15:11 GMT -5
Since we are lite on content I will post this Compendium of games we pulled together recently. They are self contained, they run but are not complete. Great to see improvements or other classic games posted here. Thanks Rod. Seeing these examples will move me closer to being able to one day create my own game in Lb. Am wondering though how hard it would be if someone totally understood the game programming, to make a game engine in Lb? I would like to see a drag and drop game engine like game maker, complete with it's own gaming language, only programmed in Lb, and obviously different so as not to copy them in any way. Something that would cut the production time in half and make it easier, and have it compile the game code to a stand alone exe file. Just an idea.
|
|
|
Post by Carl Gundel on Apr 4, 2018 11:25:34 GMT -5
Since we are lite on content I will post this Compendium of games we pulled together recently. They are self contained, they run but are not complete. Great to see improvements or other classic games posted here. Thanks Rod. Seeing these examples will move me closer to being able to one day create my own game in Lb. Am wondering though how hard it would be if someone totally understood the game programming, to make a game engine in Lb? I would like to see a drag and drop game engine like game maker, complete with it's own gaming language, only programmed in Lb, and obviously different so as not to copy them in any way. Something that would cut the production time in half and make it easier, and have it compile the game code to a stand alone exe file. Just an idea. Reminds me or Leopard, which was a scripting language that one our community members created in Liberty BASIC years ago. Oh yeah, Brandon Watts. Google is so useful. channel9.msdn.com/coding4fun/articles/Leopard-Programming
|
|
|
Post by pandawdy on Jul 14, 2019 13:17:31 GMT -5
Back in the day I always thought it would be cool to make a point and click adventure.. something similar to Shadow Gate on the NES. Seems like it woudln't be that hard to pull off with Liberty Basic.
|
|
|
Post by Rod on Dec 31, 2020 5:03:59 GMT -5
This is buried elsewhere. Since it seems to work I add it to the compendium list. Chess AI Chess AI
|
|
|
Post by brendan on Jul 25, 2021 4:55:37 GMT -5
Hi, would you have any 1st person perspective code games or snipits tucked away back there. Looking to add some small 8x8 old skool dungeon crawlers to my game. chEErs
|
|
|
Post by Rod on Jul 25, 2021 14:23:11 GMT -5
|
|
|
Post by brendan on Jul 25, 2021 15:08:41 GMT -5
Hi Rod, Looking to emulate the old dungeon crawlers like BardsTales. Only the dungeon scenes and movements. Not overly confident with sprite programming. I have been chipping away with 8 premade BMP tiles on a 800x600 screen. divided into 5 vertical panels from left to right. player only sees the square they're on and one in front + 1 each side. Attached perspective view. Just started the coding process and already it I see it growing beyond imagination. Here's a snippet of code some of it is still psuedo and unfinished. The data is simple ascii file 1=wall ,0=open [LoadMapGrid] dim MapGrid(8,8):row=1 '################################################ remoteFile$ = "/data/";filename$ call FTPdownload remoteFile$, filename$ open DefaultDir$+"\temp\";filename$ for input as #1 while eof(#1)=0 line input #1,map$ for col=1 to 8 MapGrid(row,col)=val(mid$(map$,col,1)) next col row=row+1 wend close #1 return '################################################ [ReOrientateFoward] ' get mapgrid square in front & see if its open space not wall before moving retok=0 select case dir case 1' facing north if MapGrid(row - 1,col)=0 then row=row - 1:retok=1 case 2 'facing east if MapGrid(row,col + 1)=0 then col=col + 1:retok=1 case 3 'facing south if MapGrid(row + 1,col)=0 then row=row + 1:retok=1 case 4 'facing west if MapGrid(row, col - 1)=0 then col=col - 1:retok=1 end select if retok=0 then #main.details "Ouch...." 'forward was not clear of wall no position change return [DrawDungeon] '/ 1st person perspective is divided into 5 vertical portions numbered from left (1) to right (5) '/ 1st person view range is only 2 squares forward '/ scan from L to R current COL -1 (L) across to COL +1 (R) and go 2 rows select case dir case 1' facing north picRow=1 : count = 0 [ScanAhead] for picCol=(col - 1) to (col + 1) count=count + 1 select case '// facing north case MapGrid(row - 1,picCol) = 1 AND (count=1) 'forward x1 wall on left L1=wall case MapGrid(row - 1,picCol) = 0 AND (count=1) 'forward x1 open on left L1=clear case MapGrid(row - 1,picCol) = 1 AND (count=2) 'forward x1 wall in front L1=wall case MapGrid(row - 1,picCol) = 0 AND (count=2) 'forward x1 open in front L1=clear case MapGrid(row - 1,picCol) = 1 AND (count=3) 'forward x1 wall on right L1=wall case MapGrid(row - 1,picCol) = 0 AND (count=3) 'forward x1 open on right L1=clear end select next picCol if (picRow=1) then picRow=2 : count = 0 goto [ScanAhead] end if end select return formatting obliterated..... Before getting to envolved , i'd like to examine other code. homepages.inspire.net.nz/~netescape/realm.htmlAttachments:
|
|
|
Post by Chris Iverson on Jul 25, 2021 16:32:26 GMT -5
Was reminded of that Chess AI that Rod posted. Very interesting, although I was sad when I managed to get myself into a stalemate with the really good AI, only for the game to not accept it because it's not coded to look for stalemates.
|
|
|
Post by Rod on Jul 26, 2021 1:46:54 GMT -5
|
|
|
Post by brendan on Jul 26, 2021 7:14:00 GMT -5
Thanks again. what a fantastic archive. bound to find some inspiration and ideas in there.
|
|
|
Post by dan1101 on Jul 27, 2021 13:08:36 GMT -5
Brendan, have you considered having your program randomly generate your 8 X 8 maze so that every game is different? I played around with an old-school maze program a few months ago, first published at the dawn of the home computer age. I modified the code to work in Liberty BASIC. Here is the code for you to play with if you are interested. To the best of my knowledge, the book this comes from, Basic Computer Games (1978) by David Ahl has been released to the public domain.
- Dan1101
10 CLS:PRINT TAB(19);"AMAZING PROGRAM - MAZE GENERATOR":PRINT 15 PRINT TAB(19);"ORIGINAL PROGRAM BY JACK HAUBER" 20 PRINT TAB(15);"PUBLISHED IN BASIC COMPUTER GAMES (1978)":PRINT 25 PRINT TAB(5);"EXTENSIVELY MODIFIED FOR LIBERTY BASIC BY D.L.S. (2021)" 30 PRINT 40 PRINT " This program generates a random maze which will be" 50 PRINT " different every time it is run. The maze will have" 60 PRINT " exactly one entrance, one exit, and one correct path." 70 PRINT " The entrance and exit are indicated after the maze is drawn." 100 PRINT:PRINT " MAXIMUM DIMENSIONS ARE 20 BY 20." PRINT:PRINT " WHAT IS YOUR WIDTH";:INPUT H 101 PRINT " WHAT IS YOUR HEIGHT";: INPUT V 102 IF H>1 AND V>1 THEN 110 104 PRINT " MEANINGLESS DIMENSIONS. TRY AGAIN.":GOTO 100 110 IF H<21 AND V<21 THEN 115 112 PRINT " Maximum Width= 20, Maximum Height=20":GOTO 100 115 DIM W(H,V),V(H,V) 120 CLS: PRINT 130 PRINT "MAZE DIMENSIONS" 140 PRINT "WIDTH ";H;" HEIGHT ";V 150 PRINT 160 Q=0:Z=0:X=INT(RND(1)*H+1) 162 ENTRANCE=X 165 FOR I=1 TO H 170 IF I=X THEN 173 171 PRINT ".--";:GOTO 180 173 PRINT ". "; 180 NEXT I 190 PRINT "." 195 C=1:W(X,1)=C:C=C+1 200 R=X:S=1:GOTO 260 210 IF R<>H THEN 240 215 IF S<>V THEN 230 220 R=1:S=1:GOTO 250 230 R=1:S=S+1:GOTO 250 240 R=R+1 250 IF W(R,S)=0 THEN 210 260 IF R-1=0 THEN 530 265 IF W(R-1,S)<>0 THEN 530 270 IF S-1=0 THEN 390 280 IF W(R,S-1)<>0 THEN 390 290 IF R=H THEN 330 300 IF W(R+1,S)<>0 THEN 330 310 X=INT(RND(1)*3+1) 320 SELECT CASE X CASE 1 GOTO 790 CASE 2 GOTO 820 CASE 3 GOTO 860 END SELECT 330 IF S<>V THEN 340 334 IF Z=1 THEN 370 338 Q=1:GOTO 350 340 IF W(R,S+1)<>0 THEN 370 350 X=INT(RND(1)*3+1) 360 SELECT CASE X CASE 1 GOTO 790 CASE 2 GOTO 820 CASE 3 GOTO 910 END SELECT 370 X=INT(RND(1)*2+1) 380 SELECT CASE X CASE 1 GOTO 790 CASE 2 GOTO 820 END SELECT 390 IF R=H THEN 470 400 IF W(R+1,S)<>0 THEN 470 405 IF S<>V THEN 420 410 IF Z=1 THEN 450 415 Q=1:GOTO 430 420 IF W(R,S+1)<>0 THEN 450 430 X=INT(RND(1)*3+1) 440 SELECT CASE X CASE 1 GOTO 790 CASE 2 GOTO 860 CASE 3 GOTO 910 END SELECT 450 X=INT(RND(1)*2+1) 460 SELECT CASE X CASE 1 GOTO 790 CASE 2 GOTO 860 END SELECT 470 IF S<>V THEN 490 480 IF Z=1 THEN 520 485 Q=1:GOTO 500 490 IF W(R,S+1)<>0 THEN 520 500 X=INT(RND(1)*2+1) 510 SELECT CASE X CASE 1 GOTO 790 CASE 2 GOTO 910 END SELECT 520 GOTO 790 530 IF S-1=0 THEN 670 540 IF W(R,S-1)<>0 THEN 670 545 IF R=H THEN 610 547 IF W(R+1,S)<>0 THEN 610 550 IF S<>V THEN 560 552 IF Z=1 THEN 590 554 Q=1:GOTO 570 560 IF W(R,S+1)<>0 THEN 590 570 X=INT(RND(1)*3+1) 580 SELECT CASE X CASE 1 GOTO 820 CASE 2 GOTO 860 CASE 3 GOTO 910 END SELECT 590 X=INT(RND(1)*2+1) 600 SELECT CASE X CASE 1 GOTO 820 CASE 2 GOTO 860 END SELECT 610 IF S<>V THEN 630 620 IF Z=1 THEN 660 625 Q=1:GOTO 640 630 IF W(R,S+1)<>0 THEN 660 640 X=INT(RND(1)*2+1) 650 SELECT CASE X CASE 1 GOTO 820 CASE 2 GOTO 910 END SELECT 660 GOTO 820 670 IF R=H THEN 740 680 IF W(R+1,S)<>0 THEN 740 685 IF S<>V THEN 700 690 IF Z=1 THEN 730 695 Q=1:GOTO 830 700 IF W(R,S+1)<>0 THEN 730 710 X=INT(RND(1)*2+1) 720 SELECT CASE X CASE 1 GOTO 860 CASE 2 GOTO 910 END SELECT 730 GOTO 860 740 IF S<>V THEN 760 750 IF Z=1 THEN 780 755 Q=1:GOTO 770 760 IF W(R,S+1)<>0 THEN 780 770 GOTO 910 780 GOTO 1000 790 W(R-1,S)=C 800 C=C+1: V(R-1,S)=2:R=R-1 810 IF C=H*V+1 THEN 1010 815 Q=0:GOTO 260 820 W(R,S-1)=C 830 C=C+1 840 V(R,S-1)=1:S=S-1:IF C=H*V+1 THEN 1010 850 Q=0: GOTO 260 860 W(R+1,S)=C 870 C=C+1:IF V(R,S)=0 THEN 880 875 V(R,S)=3:GOTO 890 880 V(R,S)=2 890 R=R+1 900 IF C=H*V+1 THEN 1010 905 GOTO 530 910 IF Q=1 THEN 960 920 W(R,S+1)=C:C=C+1:IF V(R,S)=0 THEN 940 930 V(R,S)=3:GOTO 950 940 V(R,S)=1 950 S=S+1:IF C=H*V+1 THEN 1010 955 GOTO 260 960 Z=1 970 IF V(R,S)=0 THEN 980 975 V(R,S)=3:Q=0:GOTO 1000 980 V(R,S)=1:Q=0:R=1:S=1:GOTO 250 1000 GOTO 210 1010 FOR J=1 TO V 1011 PRINT "I"; 1012 FOR I=1 TO H 1013 IF V(I,J)<2 THEN 1030 1020 PRINT " "; 1025 GOTO 1040 1030 PRINT " I"; 1040 NEXT I 1041 PRINT 1043 FOR I=1 TO H 1045 IF V(I,J)=0 THEN 1060 1050 IF V(I,J)=2 THEN 1060 1051 PRINT ": "; 1053 ESCAPE=I 1055 GOTO 1070 1060 PRINT ":--"; 1070 NEXT I 1071 PRINT "." 1072 NEXT J PRINT: PRINT "ENTER:";ENTRANCE;" EXIT:"; ESCAPE
1075 PRINT:PRINT "MAZE COMPLETE! Try again?";: INPUT YN$ 1090 IF YN$="Y" or YN$="y" then GOTO 10
1200 END
|
|
|
Post by brendan on Aug 1, 2021 0:15:10 GMT -5
Thanks Dan, will certainly look over the code. I opened over 50% of the programs in the JBASIC games archive to get some ideas and help on sprites. Still can't get my head around sprites so have started with this. Very close 90% to cracking it soon......
nomainwin WindowWidth = 860 : WindowHeight = 760 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
stylebits #main.bigpic, 0,_WS_BORDER,0,0 graphicbox #main.bigpic, 20, 20, 800, 600 button #main.action1, "LEFT", [action1], UL,120, 660,80,25 button #main.action2, "FORWARD", [action2], UL, 220, 660,80,25 button #main.action3, "RIGHT", [action3], UL, 320, 660,80,25 textbox #main.debug 450,660,300,25
menu #main, "edit" open "" for window as #main loadbmp "img", "background.bmp" #main.bigpic, "down ; drawbmp img 0 0; flush"
filename$="dungeon1.dat" gosub [LoadMapGrid] gosub [LoadDungeonPanels]
'// dir [1.north, 2.east, 3.south, 4.west] dir = 1 : row=9 : col=4 wait
[action1] 'turn left dir = dir - 1 if dir=0 then dir=4 gosub [DrawDungeon] wait
[action2] 'move forward gosub [ReOrientateForward] gosub [DrawDungeon] wait
[action3] 'turn right dir = dir + 1 if dir=5 then dir=1 gosub [DrawDungeon] wait
[LoadMapGrid] dim MapGrid(8,8) : row=1 open DefaultDir$+"\";filename$ for input as #1 while eof(#1)=0 line input #1,map$ for col=1 to 8 MapGrid(row,col)=val(mid$(map$,col,1)) next col row=row+1 wend close #1 return
[LoadDungeonPanels] loadbmp "A1","A1.bmp" loadbmp"A2","A2.bmp" loadbmp"A3","A3.bmp" loadbmp"A4","A4.bmp" loadbmp"S1","S1.bmp" loadbmp"S2","S2.bmp" loadbmp"F1","F1.bmp" loadbmp"F2","F2.bmp" return
[ReOrientateForward] '// check map square in front & see if its open space not wall before moving select case dir case 1' facing north if MapGrid(row - 1,col)=0 then row=row - 1 case 2 'facing east if MapGrid(row,col + 1)=0 then col=col + 1 case 3 'facing south if MapGrid(row + 1,col)=0 then row=row + 1 case 4 'facing west if MapGrid(row, col - 1)=0 then col=col - 1 end select return
[DrawDungeon] '/ 1st person perspective is divided into 5 vertical portions numbered from left (1) to right (5) '/ only 6 tiles are required. some will be flipped '/ 1st person view range is only 2 squares forward scans=1 #main.debug "row=";row;" col=";col;" dir=";dir;" scans=";scans;
[CheckThirdRow]
'/ wall infront far if MapGrid(row - 2, col - 1) = 1 then #main.bigpic "drawbmp S2 0 0" #main.bigpic "drawbmp S2 125 0" end if
[CheckStandingRow]
'/ wall to my left if MapGrid(row, col - 1) = 1 then #main.bigpic "drawbmp A1 0 0" '/ wall to my right if MapGrid(row, col + 1) = 1 then #main.bigpic "drawbmp A3 675 0" '/ wall in front if MapGrid(row - 1, col) = 1 then #main.bigpic "drawbmp F2 250 0" #main.bigpic "drawbmp S1 125 0" #main.bigpic "drawbmp S1 550 0" end if '/ dead end. no more processing if MapGrid(row, col + 1) = 1 AND MapGrid(row, col - 1) = 1 AND MapGrid(row - 1, col) = 1 then return end if
[CheckSecondRow]
'/ wall to my left second row if MapGrid(row - 1, col - 1) = 1 then #main.bigpic "drawbmp S1 125 0" '/check StandingRow again if MapGrid(row , col - 1) = 1 then #main.bigpic "drawbmp A2 125 0" '/walled if MapGrid(row , col - 1) = 0 then #main.bigpic "drawbmp S1 0 0" '/not walled #main.bigpic "drawbmp A2 125 0" '/not walled end if end if
'/ wall to my right second row if MapGrid(row - 2, col + 1) = 1 then #main.bigpic "drawbmp F2 250 0"
#main.bigpic "discard" wait
|
|