home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1984 November
/
1984-11.d64
/
jump_64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
146 lines
100 gosub1160
110 clr:s=54272:lo=54296:gosub940
120 c=peek(197):d=peek(653)
125 q$=str$(q2)+" ":ifq2<=0thenq$="0 "
130 print" sc = ";l;" lives = ";ww;" en = ";q$
140 ifq2=<0then749
150 if(c=20)and(a+2+2*d<40)then280
160 if(c=12)and(a-2-2*d>-1)then300
170 ifc=23orc=1orc=60thenq2=q2-20:goto530
180 bz=az+int(55*rnd(0))-30:t1=sgn(bz-az)
200 if (az-bz) > (29-p1) then 630
210 if bz<30orbz>310 then 180
220 if t1=1thena1=az:a2=bz:goto240
230 a1=bz:a2=az
240 fori=a1toa2stept1*6
250 if i<256 then pokev+16,peek(v+16)and254:pokev,i:next:az=bz:goto120
260 pokev+16,peek(v+16)or1:pokev,i-256:next:az=bz:goto120
270 m=5:goto120
275 rem move base ship
280 if d<>0then390
290 a=a+2:b1=bx+16:goto320
300 if d<>0then460
310 a=a-2:b1=bx-16
320 q2=q2-5:t1=sgn(b1-bx):ift1=1thena1=bx:a2=b1:goto340
330 a1=b1:a2=bx
340 fori=a1toa2stept1*4
350 if i<256 then pokev+16,peek(v+16)and253:pokev+2,i:next:bx=b1:goto370
360 pokev+16,peek(v+16)or2:pokev+2,i-256:next:bx=b1
370 if peek(1904+a)<>32andpeek(1905+a)<>32then180
380 w=w-1:gosub 733:goto 120
385 rem jump right
390 a=a+4:fori=bxtobx+16step2:y=y-2
400 if i<256 then pokev+16,peek(v+16)and253:pokev+2,i:pokev+3,y:next:goto420
410 pokev+16,peek(v+16)or2:pokev+2,i-256:pokev+3,y:next
420 fori=bx+16tobx+32step2:y=y+2
430 if i<256 then pokev+16,peek(v+16)and253:pokev+2,i:pokev+3,y:next:goto450
440 pokev+16,peek(v+16)or2:pokev+2,i-256:pokev+3,y:next
450 bx=bx+32:if peek(1904+a)<>32andpeek(1905+a)<>32then180
455 gosub 731:goto 120
458 rem jump left
460 a=a-4:fori=bxtobx-16step-2:y=y-2
470 if i<256 then pokev+16,peek(v+16)and253:pokev+2,i:pokev+3,y:next:goto490
480 pokev+16,peek(v+16)or2:pokev+2,i-256:pokev+3,y:next
490 fori=bx-16tobx-32step-2:y=y+2
500 if i<256 then pokev+16,peek(v+16)and253:pokev+2,i:pokev+3,y:next:goto520
510 pokev+16,peek(v+16)or2:pokev+2,i-256:pokev+3,y:next
520 bx=bx-32:if peek(1904+a)<>32andpeek(1905+a)<>32then180
525 gosub 731:goto 120
530 a1=106:pokes+4,33
540 ii=0:fori=1784to1144step-40:pokei+a,a1:pokei+a+s,1:pokes+1,ii:ii=ii+3
550 ifpeek(v+31)=1then cr=1:next:goto570
560 next
570 pokes+4,32:if a1=32andcr<>1 then 180
580 if cr=1 and a1=32 then 600
590 a1=32:cr=0:goto540
600 pokev+21,2:t1=int((az-bx)/8)
610 fori=1104+a+t1to1104+a+t1+3:pokei,42:pokei+s,2:nexti:gosub740
615 fori=1104+a+t1to1104+a+t1+3:pokei,32:pokei+s,2:nexti:cr=0
620 l=l+50:q2=q2+45:pokev+21,3:az=int(rnd(1)*200)+40:pokev,az:goto 120
625 rem shoot at base
630 pokes+4,33:ii=120:a1=106:t1=int(az/8)-2
640 fori=1144to1864step40:pokei+t1,a1:pokei+s+t1,1:pokes+1,ii:ii=ii-3
650 if peek(v+31)=2thencr=1:next:goto670
660 next
670 pokes+4,32:ifa1=32then 690
680 a1=32:goto 640
690 if cr=1 then gosub731:goto120
710 w=peek(1904+t1):ifw=102thenpoke1904+t1,230:goto120
715 w=peek(1904+t1):ifw=230thenpoke1904+t1,32:gosub740:goto120
720 w=peek(1944+t1):ifw=102thenpoke1944+t1,32:gosub740:goto120
730 goto 800
731 rem base destroyed
733 pokev+21,1:poke1864+a,42:poke1865+a,42:poke1864+a+s,2:poke1865+a+s,2
734 pokes+4,129:pokes+1,90
735 fori=1to300:next:pokes+4,128:if ww=1 then 800
736 ww=ww-1:poke1864+a,32:poke1865+a,32:pokev+31,0:cr=0
737 a=0:pokev+16,peek(v+16)and253:pokev+21,3
738 fora=0to32step2:ifpeek(1904+a)<>102orpeek(1905+a)<>102thennexta
739 bx=a*8+24:pokev+2,bx:return
740 pokes+4,129:pokes1,30:fori=1to50:next:pokes+4,128:return
749 print"out of energy !!":forx=1to2500:next
750 print"[147]"
760 pokes4,0
800 poke53269,0:print" game over"
810 fori=1to1500:next
820 print"[147]"
830 pokev+21,0:print"[147]":b$=" battle again ?":b1$=" (y/n)"
840 fori=1tolen(b$):print"[145]"tab(8)left$(b$,i)
850 fork=1to125:next:next
860 print:print:print
870 b1$=" (y/n)"
880 fori=1tolen(b1$):print"[145]";tab(8)left$(b1$,i)
890 fork=1to125:next:next
900 forv=1to10:geta$:next
910 getyn$:ifyn$=""then910
920 ifyn$="n"thenend
930 goto110
940 print"[147]difficulty levels[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
950 print"1-beginner"
960 print"2-rookie"
970 print"3-pro"
980 print"4-expert"
990 print"5-random"
995 print" choose 1-5"
1000 getp1$
1020 ifp1$<>"1"andp1$<>"2"andp1$<>"3"andp1$<>"4"andp1$<>"5"then1000
1040 ifp1$="5"thenp1=rnd(0)*6
1050 p1=val(p1$)
1060 fori=stolo:pokei,0:nexti:pokelo,15:pokes+5,130:pokes+6,72
1070 v=53248:pokev+21,7:poke2040,13:poke2041,14:poke2042,14
1080 pokev+39,3
1090 poke v+28,1:pokev+37,1:pokev+38,5:pokev+39,2:pokev+40,1:pokev+4,150
1100 poke53280,0:poke53281,0:w=3:print"[147]"
1110 a=0:bx=24:b=a:m=1:ac=1:a1=1232:a2=1235:q2=1000:co=v:az=200:b1=bx:y=205
1120 ww=3:forx=1904to1983:pokex,102:pokex+s,5:nextx
1130 forx=1984to2023:pokex,99:pokex+s,1:next
1140 pokev+16,0:pokev,az:pokev+1,60:pokev+2,bx:pokev+3,205
1150 return
1160 poke53281,0:poke53280,0:a$="[156]j u m p "
1200 restore:print"[147] j";
1210 fork=0to42:readq:poke832+k,q:next
1220 print" u";:fork=43to85:readq:poke832+k,q:next
1230 print" m";:fork=86to127:readq:poke832+k,q:next:print" p"
1250 print" ready to battle"
1260 print" y[146] / n[146]"
1280 gety$:ify$=""then1280
1290 ify$="n"thenend
1300 return
1310 data000,000,000,000,000,000,000,000
1320 data000,000,000,000,001,085,064,006
1330 data190,144,026,190,164,085,085,085
1340 data085,085,085,080,020,005,085,085
1350 data085,085,085,085,031,235,244,007
1360 data235,208,001,085,064,005,000,080
1370 data020,000,020,080,000,005,000,000
1380 data000,000,000,000,000,000,000,254
1390 rem
1400 data000,000,000,001,000,000,001,000
1410 data000,001,000,000,003,128,000,003
1420 data128,000,003,128,000,007,192,000
1430 data015,224,000,031,240,000,127,252
1440 data000,227,142,000,227,142,000,127
1450 data252,000,063,248,000,096,012,000
1460 data220,118,000,159,242,000,220,118
1470 data000,096,012,000,063,248,000,255