home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 September / 1985-09.d64 / friendlyalien (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  169 lines

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