home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 September
/
1985-09.d64
/
friendlyalien
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
169 lines
5 rem*vicfriendlyalien
6 goto20
7 print"time: ";mid$(ti$,3,2);":";right$(ti$,2)
8 ifti$>tu$thenprint"time is up!!! ":fori=1to1500:next:goto1300
9 return
11 lo=lo-q2:return
12 lo=lo-q1:return
13 lo=lo+p1:return
14 lo=lo+q3:return
15 lo=lo+q2:return
16 lo=lo+q1:return
17 lo=lo-p1:return
18 lo=lo-q3:return
20 ifpeek(44)<32thenpoke56,28:poke52,28:clr
30 print"[147][144]****friendly alien****[146]
35 [153]"setting up....
40 nm=7168:fori=nmtonm+511:pokei,peek(i+25600):next
50 fori=nm+272tonm+311:reada:pokei,a:next
58 fori=nm+344tonm+383:reada:pokei,a:next
62 fori=0to7:pokenm+8*59+i,peek(32768+81*8+i):next:pokenm+8*59+3,255
64 fori=0to7:pokenm+8*61+i,peek(32768+8*77+i):next:ck=0
68 fori=0to31:reada:ck=ck+a:pokenm+i,a:next
69 fori=0to7:reada:ck=ck+a:pokenm+8*60+i,a:next
94 fori=832to936:reada:ck=ck+a:pokei,a:next
95 ifck=16964then100
96 print"[144]*data statement error** see lines 8070-9040*":end
100 x=rnd(-ti)
110 print"[147]guide the little alienwith a joystick and pick up all the candy.
135 [153]"stopthen guide him to the phone and spaceship.
160 print"look out for the cans of cola. if he drinks cola,";
161 print" he will have an allergic reaction and can't be guided.
165 [153]"stopif he touches a flu bug, or if you run outof time,";
167 [153]" he will get the flu and can't go home.
169 print"you've 1 min. 30 sec.
500 [153]"clrenter skill level 1-5wait
502 geta$:ifa$=""then502
503 a=val(a$):ifa<1ora>5then500
505 sc=4*(peek(36866)and128)+64*(peek(36869)and112)
510 cm=37888+4*(peek(36866)and128)-sc:print"[147]"
515 poke36869,peek(36869)and240or15
517 vl=36878:sl=36874:sh=36876:q1=21:q2=22:q3=23:p1=1
519 rem**build border
520 forb=sc+q2tosc+44:pokeb,35:pokecm+b,6:next
525 forb=sc+43tosc+505stepq2:pokeb,35:pokecm+b,6:next
530 forb=sc+504tosc+484step-1:pokeb,35:pokecm+b,6:next
535 forb=sc+484tosc+q2step-q2:pokeb,35:pokecm+b,6:next
600 rem**place flubugs
605 fori=1to9*a
610 gosub4000
612 ifpeek(x)=35then610
620 pokex,42:pokecm+x,3:ifi<=athenf(i)=x:pokex+cm,7
622 next
700 rem**place cola
705 fori=1to12*a
710 gosub4000
720 ifpeek(x)=35orpeek(x)=42orpeek(x-q2)=36orpeek(x+q2)=36then710
725 pokex,36:pokecm+x,2:next
800 rem**place candy
803 c=2:fori=1to20:c=c+1:ifc>7thenc=2
810 gosub4000
820 ifpeek(x)<>32orpeek(x+1)<>32orpeek(x-1)<>32orpeek(x+q2)<>32orpeek(x-q2)<>32then810
825 pokex,34:pokecm+x,c:next
830 rp=20:lo=sc+460:ti$="000000":tu$="000129"
899 rem**main loop
900 ifrp=0then3000
920 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
922 gosub7
930 pokevl,10:pokesh,220:goto1500
935 pokevl,0:pokesh,0
1000 sys832:aa=peek(830)
1050 lt=lo:onaagosub11,12,13,14,15,16,17,18
1080 pokelt,32:pokelt+q2,32
1099 rem**collision ck
1100 tl=peek(lo):bl=peek(lo+q2)
1102 iftl=1ortl=3ortl=35orbl=0orbl=2orbl=35thenlo=lt:goto900
1110 iftl=42orbl=42then1300
1115 iftl=61orbl=61then3500
1120 iftl=36orbl=36then1400
1130 iftl=34orbl=34thenrp=rp-1:goto1200
1135 iftl=45ortl=46ortl=47orbl=47then3100
1140 goto900
1199 rem**candy pickup
1200 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
1210 pokesh,150:pokevl,15:forl=1to10:next
1220 pokesh,200:forl=1to10:next:pokesh,0:pokevl,0:goto900
1299 rem**flubug collision
1300 pokelo,37:pokelo+q2,38:pokelo+cm,3:pokelo+cm+q2,3
1305 forz=1to10
1310 pokesh,150:pokevl,15:forl=1to50:next
1320 pokesl,150:forl=1to50:next
1325 pokesh,0:forl=1to50:next:next:pokevl,0:pokesl,0:goto2000
1399 rem**cola collision (glug-glug)
1400 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
1410 pokesh,0:pokevl,10:forx=1to3:pokesl,210:forl=1to10:next:pokesl,250:forl=1to25:next
1412 pokesl,0:forl=1to200:next:next
1415 pokelo,32:pokelo+q2,32:pokelo+cm,1:pokelo+cm+q2,1
1416 aa=int(rnd(1)*8)+1:goto1050
1499 rem**select & move flubug
1500 d=int(rnd(1)*a)+1
1510 lt=lo:lo=f(d):x=int(rnd(1)*8)+1:ft=f(d)
1515 onxgosub11,12,13,14,15,16,17,18
1635 f(d)=lo:lo=lt:ifpeek(f(d))<>32andpeek(f(d))<>37andpeek(f(d))<>38thenf(d)=ft
1700 pokeft,32
1702 iff(d)=loorf(d)=lo+q2thenpokelo+cm,3:pokelo+cm+q2,3:goto1305
1710 pokef(d),42:pokef(d)+cm,7:goto935
2000 pokevl,0:pokesh,0
2001 print"[147][144]he caught the flu fromthe flu bug and can not go home."
2002 goto2040
2025 print"[147][144] you won!!"
2030 print" ";mid$(tt$,3,2);" minute ";right$(tt$,2)" seconds
2035 [153]" skill level"a
2040 [153]" play again?"
2045 [151]36869,[194](36869)[175]240[176]0
2050 [161]a$:[139]a$[178]""[167]2050
2055 [139]a$[178]"y"[167][138]100
2060 [153]"load":[128]
2999 [143]**build spacephone
3000 q[178]sc[170]44:r[178]sc[170]88:[141]6000:[141]7:[151]lo,32:[151]lo[170]q2,32:lo[178]sc[170]460
3002 [153]"open+, ":[153]"-.sys/ ":rp[178]20:[137]900
3099 [143]**ring spacephone
3100 lo[178]sc[170]48:[151]lo,37:[151]lo[170]q2,38:[151]lo[170]cm,4:[151]lo[170]cm[170]q2,4
3110 [151]vl,15:[129]l[178]1[164]3:[129]m[178]1[164]50:[151]sh,230:[129]n[178]1[164]5:[130]
3120 [151]sh,0:[130]:[141]7:[129]m[178]1[164]1000:[130]:[141]7:[130]:[151]vl,0
3399 [143]**build spaceship
3400 q[178]sc[170]110:r[178]sc[170]242:[141]6000:[141]7
3401 [153]" ":[153]" "
3402 lo[178]sc[170]460:[151]lo,37:[151]lo[170]q2,38:[151]lo[170]cm,4:[151]lo[170]cm[170]q2,4
3406 [141]7:[141]3600:[141]7
3408 [153]""[166]10)"open;
3410 gosub3600:gosub7
3425 print""spc(9)"[159]@#b
3430 [153][166]7)"<<###<<
3435 printspc(9)"a#c
3440 [141]7:[141]3600:[141]7
3450 [153]""[166]8)"open@###b
3452 printspc(8)"[159]#####
3460 [153][166]5)"open###########
3462 printspc(8)"[159]#####
3470 [153][166]8)"opena###c
3480 gosub7:gosub3600:gosub7
3490 t=sc+189:forb=1to3:poket,61:pokecm+t,3:t=t+q3:next:pokesc+215,32:pokesc+237,32
3495 pokevl,0:pokesh,0:rp=20:goto900
3499 rem**put alien on ramp
3500 tt$=ti$:lo=sc+214:pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
3505 forl=1to1500:next
3510 pokesc+214,32:pokesc+236,32:pokesc+212,32:pokesc+189,32:pokesc+235,32
3520 forl=1to2000:next:goto2025
3599 rem**spaceship sound
3600 pokevl,15:forl=1to5:form=220-lto160-lstep-4:pokesh,m:next
3640 form=160-lto220-lstep4:pokesh,m:next:gosub7:next:return
4000 x=int(rnd(1)*372)+sc+3*q2:return
5999 rem**relocate flubugs
6000 fori=1toa:iff(i)>qandf(i)<rthenpokef(i),32:f(i)=f(i)+154
6022 nexti:return
8000 rem**custom character data
8070 data,,,24,24,,,,255,255,255,255,255,255,255,255,,,56,56,56,56,56,56
8075 data36,126,126,60,24,24,24,60,126,189,189,189,189,36,66,66
8080 data,,31,127,127,255,255,255,,,248,240,224,192,128,,254,253,248,240,224,192,128
8085 data,,,128,64,32,18,9,6,63,33,63,63,43,53,235,63
8090 data7,31,63,127,127,255,255,255,255,255,255,127,127,63,31,7
8092 data224,248,252,254,254,255,255,255,255,255,255,254,254,252,248,224
8093 data,,,255,255,255,,
8999 rem**ml joystick routine
9000 data120,8,72,152,72,138,72,173,19,145,72,173,34,145,72,169,0,141,62,3,141,63,3,169
9010 data127,141,34,145,173,32,145,73,255,41,128,42,8,169,195,141,19,145,173,17,145,73
9020 data255,41,60,74,74,40,42,168,41,16,201,16,208,3,141,63,3,152,41,15,162,0,232,224
9030 data9,240,8,221,160,3,208,246,142,62,3,104,141,34,145,104,141,19,145,104,170,104
9040 data168,104,40,88,96,2,3,1,5,4,12,8,10