home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun: Game Pak
/
rerun-gamepak
/
shuffle
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
124 lines
5 rem 64 shuffle *** buck childress
10 rem p.o. box 2072, white city, or 97503
15 print"[147]setting up...please wait"
20 print"approximately 30 seconds"
25 poke52,48:poke56,48:clr:gosub700
30 input"[147]how many players (1-2)";np:print"[147]"
40 ifnp<>1andnp<>2then30
50 y2=56321:ifnp=2theny2=56320
60 dime(6):dimj(6):dimp(6):dimu(6):e=84:u=6:c=54272
70 so=49152:pl=1464:a=1:y1=56321:y=y1:poke53280,12
80 poke53281,3:gosub800:gt=1:gosub470:gt=0
100 rem ************ handling routine ************
110 m=0:f=0:pokepl,85:pokepl+c,u
115 geta$:fb=peek(y)and16:iffb=0andh=0thenh=1:ts=ti
120 ifa$="r"thenclr:poke198,0:goto30
125 ifh1=0theniffb=16andh=1thentf=ti:h1=1
130 r=peek(y)and8:ifr=0thengosub230
135 l=peek(y)and4:ifl=0thengosub200
140 js=peek(y)and1
145 ifjs=0andh=1andfb>0thenh=0:h1=0:d=d+1:p(d)=int((tf-ts)/6):goto160
150 goto115
160 x=x+1:pokepl,86:pokepl+c,u:ifp(d)>28thenp(d)=38-d
170 b=pl+p(d):forj=pl+1tob:m=m+1:f=f+1:pokej,e:pokej+c,u
175 ifpeek(j+1)=83orpeek(j+1)=84thengosub650:gosub300:goto100
180 forjj=1to40:next:pokej,32:next:pokej,e
185 pokej+c,u:p(d)=m-1:ifp(d)>28thengosub600
190 gosub400:goto100
200 rem ********** player movement **********
210 ifpl>1305thenpokepl,32:pl=pl-40:pokepl,85:pokepl+c,u
220 return
230 ifpl<1585thenpokepl,32:pl=pl+40:pokepl,85:pokepl+c,u
240 return
300 rem ********** puck collisions **********
305 ifpeek(j)<>peek(j+1)thent=t+1:ift>1then375
310 fori=1to6:ifj(i)=j+1then320
315 next
320 forj1=j+1tob:pokej1,e(i):pokej1+c,u(i)
325 ifpeek(j1+1)=83orpeek(j1+1)=84then345
330 forjj=1to60:next:pokej1,32:f=f+1:next:pokej1,e(i):pokej1+c,u(i)
335 p(i)=f-1:p(d)=m-2:j(i)=j1:ifp(i)>28thengosub600
340 gosub400:j1=b:j=b:i=6:return
345 ifpeek(j1)<>peek(j1+1)thent=t+1:ift>1thengosub650:pokej1+c,1:goto375
350 gosub650:p(i)=f-1:j(i)=j1
355 fori=1to6:ifj(i)=j1+1then365
360 next
365 f=f+1:forj1=j1+1tob:pokej1,e(i):pokej1+c,u(i):goto325
375 ifd<4thend=3:g=1:g1=2
380 ifd>3thend=6:g=4:g1=5
385 pokej+c,1:fori=gtog1:pokej(i)+c,1:next:gosub670:forjj=1to1250:next
390 pokej1,32:pokej,32:fori=gtog1:pokej(i),32:next
395 gosub415:j1=b:j=b:return
400 rem ********** changing sides **********
405 j(d)=j:e(d)=e:u(d)=u:ifd=3ord=6then415
410 return
415 t=0:x=0:ifd=6thengosub435:a=-a:ifa=-1thenu=6
420 ifd<>3anda=1then430
425 ifu=6thenu=2:e=83:y=y2:return
430 u=6:e=84:y=y1:return
435 forn=1to1500:next:ford=1to6:gosub450:pokej(d),32:next:d=0
440 ll=0:ifvs>=150orhs>=150thenifvs<>hsthengosub900:goto490
445 return
450 rem ********** counting the score **********
455 ifpeek(j(d))=e(d)thenifp(d)>25andp(d)=<28thensc=25
460 ifpeek(j(d))=e(d)thenifp(d)>21andp(d)=<25thensc=10
465 ifpeek(j(d))=e(d)thenifp(d)>17andp(d)=<21thensc=5
470 ife(d)=84orgt=1thenvs=vs+sc:print"";vs
475 ife(d)=83orgt=1thenhs=hs+sc:print""tab(31)hs
480 ifsc>0thensc=0:gosub500
485 return
490 geta$:ifa$<>"r"then490
495 clr:poke198,0:goto30
500 rem ********** scoring bell **********
510 ifll=1then530
520 ll=1:forn=0to24:pokec+n,0:next:pokec+24,15
530 forn=1to3:pokec+1,35:pokec+5,20:pokec+6,9
540 pokec+15,30:pokec+4,17:fornn=1to60:next
550 pokec+4,16:fornn=1to150:next:next:sysso:return
600 rem ******* sound of puck going out ********
610 forn=0to24:pokec+n,0:next:forn=1to10:pokec+1,35
620 pokec+5,20:pokec+6,9:pokec+15,30:pokec+24,n:next
630 sysso:return
650 rem ********** sound of pucks hitting each other **********
655 forn=0to24:pokec+n,0:next:pokec+1,130:pokec+5,7
660 pokec+15,30:pokec+24,15:pokec+4,21:forn=1to100:next:pokes+4,20
665 sysso:return
670 rem ********** sound when pucks disappear **********
675 forn=0to24:pokec+n,0:next:forn=1tox:pokec+1,240:pokec+5,9
680 pokec+15,130:pokec+24,15:pokec+4,21:fornn=1to200:next
685 pokec+4,20:next:sysso:return
700 rem *** custom characters and sys command (gently turn off sound) ***
710 forn=1to24:reada:next
720 poke56334,peek(56334)and254:poke1,peek(1)and251
730 forn=0to2047:poken+12288,peek(n+53248):next:poke1,peek(1)or4
740 poke56334,peek(56334)or1:poke53272,(peek(53272)and240)or12
750 forn=12952to12983:reada:poken,a:next
760 forn=49152to49170:reada:poken,a:next:restore:return
800 rem ********** playing area **********
810 w=1:forn=1264to1283:gosub890:next:forn=1664to1683:gosub890:next
820 w=7:forn=1284to1287:gosub890:next:forn=1684to1687:gosub890:next
830 w=5:forn=1288to1291:gosub890:next:forn=1688to1691:gosub890:next
840 w=0:forn=1292to1294:gosub890:next:forn=1692to1694:gosub890:next
850 w=15:forn=1295to1303:gosub890:next:forn=1695to1703:gosub890:next
855 forn=1343to1663step40:gosub890:next
860 print"[144]"tab(21)"51025out"
870 print""tab(21)"51025out"
880 return
890 poken,160:poken+c,w:return
900 rem ************ victory ************
910 ifvs>hsthenprint"";vs
920 ifhs>vsthenprint""tab(31)hs
930 forn=ctoc+24:poken,0:next:forn=1to3:pokec+5,85
940 pokec+6,85:pokec+12,85:pokec+13,85:pokec+24,15:pokec+4,33
950 pokec+11,17:forw=1to6:reada1,a2,a3,a4:pokec+1,a1:pokec,a2
960 pokec+8,a3:pokec+7,a4
970 ifa1=50thenforj=1to200:next
980 forj=1to100:next
990 next:pokec+4,32:pokec+11,16:forj=1to500:next
995 restore:sysso:next:return
1000 data25,30,18,209,33,135,25,30,42,62,31,165,50,60,37,162
1010 data42,62,31,165,50,60,37,162,0,60,126,255,255,126,60
1020 data0,0,60,126,255,255,126,60,0,16,16,248,184,184,104
1030 data40,46,64,64,224,224,240,168,164,163,169,0,133,253,169
1040 data212,133,254,160,0,152,145,253,200,192,24,208,249,96