home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 129
/
129.d81
/
sr
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
15KB
|
516 lines
10 goto3090
20 rem -- game screen --
30 poke53269,0:print"[147]";:poke53275,0
40 poke53265,peek(53265)or64
50 poke53281,4:poke53280,6:poke53282,1:poke53283,0:poke53284,7
60 fori=.to23:print"[154]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[157][148]@":next
70 print"[160][160][200][189][200][197][204][208][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][209][189][209][213][201][212][160][157][148][160]"
80 printtab(15)"[150]#$#$#$[150]#$#$"
90 printtab(15)"[150]%&%&%&[150]%&%&@"
100 printtab(15)"[150]#$@@[150]#$@@[150]#$@"
110 printtab(15)"[150]%&@[150]%&@[150]%&@"
120 fori=1to2
130 printtab(15)"[150]#$@[150]#$@[150]#$@":printtab(15)"[150]%&@[150]%&@[150]%&@"
140 next
150 printtab(3)"[150]#$#$#$#$#$#$#$@[150]#$@#$[150]#$#$#$#$#$#$"
160 printtab(3)"[150]%&%&%&%&%&%&%&@[150]%&@%&[150]%&%&%&%&%&%&@"
170 printtab(3)"#$@@@@@@@@@@@@@[153]#$@@@@@@@@@@@@#$@"
180 printtab(3)"%&@"tab(19)"[153]%&@"tab(35)"%&@"
190 printtab(3)"[150]#$#$#$#$#$#$#$[150]#$@#$[150]#$#$#$#$#$#$@"
200 printtab(3)"[150]%&%&%&%&%&%&%&@[150]%&@%&[150]%&%&%&%&%&%&@"
210 printtab(4)"@@@@@@@@@@@[150]#$@[150]#$@[150]#$@@@@@@@@@@@@@"
220 printtab(15)"[150]%&@[150]%&@[150]%&@"
230 fori=1to2
240 printtab(15)"[150]#$@[150]#$@[150]#$@":printtab(15)"[150]%&@[150]%&@[150]%&@"
250 next
260 printtab(15)"[150]#$#$#$[150]#$#$@"
270 printtab(15)"[150]%&%&%&[150]%&%&@"
280 printtab(16)"@@@@@@@@@@"
290 printtab(2)" "tab(27)" "
300 fori=.to3:printtab(2)"[144] [146]@"tab(27)"[144] [146]@":next
310 printtab(3)"@@@@@@@@@@@"tab(28)"@@@@@@@@@@@"
320 poke214,16:print
330 printtab(2)"[144] "tab(27)" "
340 fori=.to3:printtab(2)"[144] [146]@"tab(27)"[144] [146]@":next
350 printtab(3)"@@@@@@@@@@@"tab(28)"@@@@@@@@@@@"
360 poke214,2:print
370 printtab(3)"[156]star race":printtab(3)"a game by":printtab(3)"tony rose"
380 poke214,17:print""
390 printtab(31)d$(5)""
400 rem -- sprites --
410 poke51192,128:poke53285,14:poke53286,10:poke53276,1
420 fori=.to3:poke53287+i,0:next
430 poke53250,184:poke53251,135:poke53252,160:poke53253,135
440 poke53254,172:poke53255,156:poke53256,172:poke53257,114
450 poke53258,184:poke53259,135:poke53260,160:poke53261,135
460 poke53262,172:poke53263,156
470 rem -- main --
480 ifd<>6andd<>1thenpl=pl+1:ifpl>2thenpl=1
490 poke214,2:print
500 printtab(30)c$(-(pl=2))"knees"
510 printtab(31)""np(2)
520 poke214,17:print
530 printtab(6)c$(-(pl=1))"you"
540 printtab(6)""np(1)
550 poke214,23:print:printtab(13)tn$(pl)""
560 gosub1040
570 ifpl=2then1320
580 gosub1190:iff=0then480
590 rem -- move the hand --
600 geta$:j=peek(jy)and15
610 ifa$=""orj=7then650
620 ifa$="[157]"orj=11then670
630 ifa$=chr$(13)or(peek(jy)and16)=.then730
640 goto600
650 hp=hp+1:ifhp>57thenhp=1
660 goto680
670 hp=hp-1:ifhp<1thenhp=57
680 yp=bd(hp,1)*8+64:xp=bd(hp,2)*8+32
690 ifxp>255thenpoke53264,1
700 poke53248,xpand255:poke53249,yp:ifxp<256thenpoke53264,0
710 goto600
720 rem -- move --
730 ifbd(hp,0)=1then600
740 ifbd(hp,0)=2andbd(hp,3)=2then600
750 f=0:fori=1to4
760 ifmp(i)=0andhp>1then780
770 ifmp(i)+d=hpthenf=i
780 next
790 iff=0then600
800 rem -- erase --
810 ifmp(f)=0thennp(1)=np(1)-1:goto860
820 bd(mp(f),0)=0
830 poke214,bd(mp(f),1):print
840 poke646,bd(mp(f),3):printtab(bd(mp(f),2))"#$[157][157]%&"
850 rem -- place --
860 gosub2570:poke214,bd(hp,1):print
870 poke646,bd(hp,3):printtab(bd(hp,2))m$(1)
880 mp(f)=hp:f=0:ifbd(hp,0)thenf=1
890 bd(hp,0)=1:gosub2620
900 rem -- reach home? --
910 ifhp<>57then970
920 bd(57,0)=0:gosub2800
930 poke214,bd(57,1):print
940 poke646,bd(57,3):printtab(bd(57,2))"#$[157][157]%&"
950 w(pl)=w(pl)+1:ifw(pl)=4then1870
960 goto480
970 iff=0then480
980 rem -- which piece --
990 fori=1to4
1000 ifk(i)=kb(hp)thenk(i)=0:i=4
1010 next
1020 np(2)=np(2)+1:gosub2710:goto480
1030 rem -- roll the die --
1040 poke53269,0:poke53248,42:poke53249,200:poke53264,1:poke53269,1
1050 geta$:ifa$=chr$(13)or(peek(jy)and16)=.then1090
1060 ifa$="h"thengosub2460:poke53269,.:gosub4030:gosub2500:poke53269,1
1070 ifa$="q"thengosub2460:poke53269,.:gosub2310:gosub2500:poke53269,1
1080 goto1050
1090 fori=1to4:d=int(rnd(1)*6)+1
1100 poke214,17:print""
1110 printtab(34-i)l$d$(d):gosub2660
1120 next
1130 fori=1to4:d=int(rnd(1)*6)+1
1140 poke214,17:print
1150 printtab(26+i)r$d$(d):gosub2660
1160 next
1170 return
1180 rem -- can you move? --
1190 f=0:fori=1to4
1200 ifmp(i)=0andd<>1then1240
1210 ifmp(i)+d>57then1240
1220 ifbd(mp(i)+d,0)=0thenf=1:i=4:goto1240
1230 ifbd(mp(i)+d,0)=2andbd(mp(i)+d,3)<>2thenf=1:i=4
1240 next
1250 iff=0thenreturn
1260 xp=bd(hp,2)*8+32:yp=bd(hp,1)*8+64
1270 poke53269,0:poke53248,xpand255:poke53249,yp
1280 ifxp>255thenpoke53264,1:goto1300
1290 poke53264,0
1300 poke53269,1:return
1310 rem -- computer --
1320 fori=1to4
1330 x=k(i)+d:mv(i)=0
1340 ifk(i)=0andd<>1then1420
1350 ifx>57then1420
1360 ifbd(kb(x),0)=1thenifbd(kb(x),3)=10thenmv(i)=5:goto1420
1370 ifx=1andk(i)=0thenifbd(kb(x),0)<>2thenmv(i)=4:goto1420
1380 ifk(i)=1thenifbd(kb(x),0)=0thenmv(i)=3:goto1420
1390 ifx=57thenmv(i)=2:goto1420
1400 ifbd(kb(x),0)=0thenifbd(kb(x),3)=2thenmv(i)=1:goto1420
1410 ifbd(kb(x),0)=0thenmv(i)=rnd(1)
1420 next
1430 f=0:m=0:fori=1to4
1440 ifmv(i)>mthenm=mv(i):f=i
1450 next:m=k(f)+d
1460 iff=0then480
1470 xp=bd(kb(kp),2)*8+32:yp=bd(kb(kp),1)*8+64
1480 gosub1270
1490 rem -- knees moves --
1500 ifk(f)+d<=kpthen1560
1510 kp=kp+1:xp=bd(kb(kp),2)*8+32:yp=bd(kb(kp),1)*8+64
1520 ifxp>255thenpoke53264,1
1530 poke53248,xpand255:poke53249,yp
1540 ifxp<256thenpoke53264,0
1550 goto1500
1560 ifk(f)+d=kpthen1630
1570 kp=kp-1:xp=bd(kb(kp),2)*8+32:yp=bd(kb(kp),1)*8+64
1580 ifxp>255thenpoke53264,1
1590 poke53248,xpand255:poke53249,yp
1600 ifxp<256thenpoke53264,0
1610 goto1560
1620 rem -- erase knees --
1630 ifk(f)=0thennp(2)=np(2)-1:goto1690
1640 bd(kb(k(f)),0)=0
1650 poke214,bd(kb(k(f)),1):print
1660 poke646,bd(kb(k(f)),3)
1670 printtab(bd(kb(k(f)),2))"#$[157][157]%&"
1680 rem -- place knees --
1690 gosub2570:poke214,bd(kb(m),1):print
1700 poke646,bd(kb(m),3):printtab(bd(kb(m),2))m$(2)
1710 k(f)=k(f)+d:f=0:ifbd(kb(m),0)thenf=1
1720 bd(kb(m),0)=2:gosub2620
1730 rem -- reach home? --
1740 ifkp<>57then1800
1750 bd(57,0)=0:gosub2800
1760 poke214,bd(57,1):print
1770 poke646,bd(57,3):printtab(bd(57,2))"#$[157][157]%&"
1780 w(pl)=w(pl)+1:ifw(pl)=4then1870
1790 goto480
1800 iff=0then480
1810 rem -- which piece --
1820 fori=1to4
1830 ifmp(i)=kb(m)thenmp(i)=0:i=4
1840 next
1850 np(1)=np(1)+1:gosub2710:goto480
1860 rem -- game over --
1870 gosub2460:fori=.to2:gosub3010:next
1880 poke53269,0:poke53276,240:poke53264,0:poke53248,172:poke53249,114
1890 ifpl=2then1920
1900 fori=.to7:poke51192+i,129+i:next
1910 poke53291,7:poke53292,2:poke53293,2:poke53294,1:goto1960
1920 fori=.to7:poke51192+i,137+i:next
1930 poke53291,8:poke53292,3:poke53293,3:poke53294,1
1940 poke214,8:print
1950 printtab(19)"[156][160][160][157][157][170][170]"
1960 poke53269,255:gosub2950
1970 poke214,1:print
1980 fori=1to5:printtab(2)" ":next
1990 printtab(14)"@@@@@@@@"
2000 poke55591,2:poke55592,2:poke55595,2:poke55596,2:poke55599,2:poke55600,2
2010 poke214,16:print
2020 fori=1to5:printtab(2)" ":next
2030 printtab(14)"@@@@"
2040 poke56191,2:poke56192,2:poke56193,2:poke56194,2:poke56195,4:poke56196,4
2050 poke56197,2:poke56198,2:poke56199,2:poke56200,2
2060 ifpl=2then2110
2070 rem -- human win --
2080 printtab(5)"[156]you have beaten knees calhoon!"
2090 printtab(9)"way to go, star racer!":goto2140
2100 rem -- knees win --
2110 printtab(6)"[156]knees calhoon wins the race!"
2120 printtab(11)"(but it was close)"
2130 rem -- play again? --
2140 poke214,17:print
2150 printtab(7)"do you want to play again?"
2160 printtab(15)"(y[156]) or (n[156])"
2170 geta$:ifa$="n"then2260
2180 ifa$<>"y"then2170
2190 poke53269,0:gosub2500
2200 poke214,10:print
2210 fori=.to2:printtab(7)"[160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160]":next
222