home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 1 #4 / utv1n4s1.d64 / rob.p (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  11KB  |  452 lines

  1. 100 rem ***************************************
  2. 110 rem **   escape from the alien robots    **
  3. 120 rem **                                   **
  4. 130 rem **   bruce jaeger,  st. paul  minn.  **
  5. 140 rem ***************************************
  6. 150 rem
  7. 180 poke 2045,peek(52):poke 2046,peek(56) : remember limits
  8. 190 poke 52,56:poke56,56:clr:rem protect characters
  9. 200 poke 2043,1:poke 2044,5:rem init degre of difficulty
  10. 210 gosub 3580 : rem poke ml, read characters
  11. 230 gosub 4000 : rem initialize variables
  12. 400 gosub 10000 : rem copyright screen
  13. 410 gosub 2100 : rem instructions
  14. 425 :
  15. 430 remark: program restart point here
  16. 431 rem     **************************
  17. 432 :
  18. 434 poke 54273,0:rem sound off
  19. 435 clr : rem "make [211][213][210][197] everything is reset!
  20. 436 [141] 4000 : [143] initialize variables
  21. 437 [141] 2770 : [143] new lev diff
  22. 440 [141] 3430 : [143] draw fence
  23. 450 [141] 4200 : [143] create random internal pits
  24. 460 [141] 4300 : [143] create random barriers
  25. 580 [141] 4400 : [143] locate human character
  26. 590 [141] 4500 : [143] place robots
  27. 720 [141] 2010 : [143] wait for fire button
  28. 721 dt[178](7[171]dk)[172]25 : [143] delay between moves
  29. 722 :
  30. 730 [143]ark: main-action-loop
  31. 735 [143] ******************** <<<<<<<<<<<<<
  32. 740 [143]ark: get joystick value
  33. 750 ti$[178]"000000" : am [178] 0
  34. 770 js[178][194](jt [170] ([194](jp)[175]15))
  35. 780 [161] kp$: [139] kp$[178][199](140) [167] 2760
  36. 790 [139] js[179][177]0 [167] 820
  37. 800 [139] ti[179]dt [167] 770
  38. 810 am[178]1 : [143] automatic move
  39. 815 :
  40. 820 [143]ark: move-the-human
  41. 830 oy[178]hy : ox[178]hx
  42. 845 [143]    if am then 930
  43. 850 [139] js[178]1 [167] hy[178]hy[171]1 : [137] 930
  44. 860 [139] js[178]2 [167] hy[178]hy[171]1 : hx[178]hx[170]1 : [137] 930
  45. 870 [139] js[178]3 [167] hx[178]hx[170]1 : [137] 930
  46. 880 [139] js[178]4 [167] hy[178]hy[170]1 : hx[178]hx[170]1 : [137] 930
  47. 890 [139] js[178]5 [167] hy[178]hy[170]1 : [137] 930
  48. 900 [139] js[178]6 [167] hy[178]hy[170]1 : hx[178]hx[171]1 : [137] 930
  49. 910 [139] js[178]7 [167] hx[178]hx[171]1 : [137] 930
  50. 920 [139] js[178]8 [167] hy[178]hy[171]1 : hx[178]hx[171]1 : [137] 930
  51. 925 :
  52. 930 [143]ark: move pieces
  53. 940 [141] 3340 : [143] ding
  54. 950 xc[178]hx : yc[178]hy
  55. 970 [139] am [167] [137] 1020
  56. 980 [141] 1390:[143] set pv=peek(dest)
  57. 990 [139] pv[177]90 [175] pv[179]103 [167] [137] 2470
  58. 991 [143] 109=barrier:103=pit:106=robot
  59. 1000 [139] pv [178] 103 [167] [137] 2530
  60. 1010 [139] pv [178] 106 [167] [137] 2590
  61. 1015 [139] pv[178]109 [167] xc[178]ox:hx[178]ox:yc[178]oy:hy[178]oy
  62. 1020 [143]ark: alternatecharacter
  63. 1030 [139] hu[178]1 [167] hu[178]2:pd$[178]hc$:[137] 1050
  64. 1040 hu [178] 1 : pd$ [178] h2$
  65. 1050 p1$ [178] h1$
  66. 1060 [141] 1740
  67. 1061 :
  68. 1065 [143] move robots
  69. 1070 [129] i [178] 1 [164] nr
  70. 1080 rx [178] rx(i)
  71. 1090 ry [178] ry(i)
  72. 1100 [139] rx[178]0 [176] ry[178]0 [167] [137] 1280
  73. 1110 ox [178] rx
  74. 1120 oy [178] ry
  75. 1130 rx [178] [180](hx [171] rx) [170] ox
  76. 1140 ry [178] [180](hy [171] ry) [170] oy
  77. 1150 rx(i) [178] rx
  78. 1160 ry(i) [178] ry
  79. 1170 xc[178]rx
  80. 1180 yc[178]ry
  81. 1190 [141] 1390
  82. 1200 [139] pv[177]90 [175] pv[179]103 [167] [141] 1670:[137] 1280
  83. 1210 [139] pv [178] 103[167][141]1590:[137] 1280
  84. 1220 [139] pv [178] 104 [176] pv[178]108 [167] hd[178]1
  85. 1225 [139] pv[178]109 [176] pv[178]106 [167] xc[178]ox:rx[178]ox:yc[178]oy:ry[178]oy:rx(i)[178]ox:ry(i)[178]oy
  86. 1230 xc [178] rx
  87. 1240 yc [178] ry
  88. 1250 pd$ [178] rc$
  89. 1260 p1$ [178] r1$
  90. 1270 [141] 1740
  91. 1280 [143]ark: loopskip
  92. 1290 [130] i
  93. 1300 [139] hd [167] [137] 2590
  94. 1310 [139] lr[178]0 [137] 2400
  95. 1320 [137] 730
  96. 1330 [143]ark: subroutines ********************
  97. 1340 [143]ark: find.empty.spot.in.compound
  98. 1345 [143] (at random)
  99. 1350 yc[178][181]([187](1)[172]14)[170]3
  100. 1360 xc[178][181]([187](1)[172](ho[171]6))[170]4
  101. 1370 [141] 1390 : [139] pv[179][177]32 [167] [137] 1350
  102. 1380 [142]
  103. 1385 :
  104. 1390 [143]ark: peek.a.place
  105. 1400 [141] 1560
  106. 1420 pv [178] [194](pa):[142]
  107. 1430 :
  108. 1480 [143] poke.a.place
  109. 1490 [141] 1560
  110. 1510 [151] pa, pv : [142]
  111. 1520 :
  112. 1560 [143]ark: calculate.address
  113. 1570 pa[178]ss[170]cw%[170]((yc[171]2)[172]cw%)[170]xc[170]2
  114. 1580 [142]
  115. 1585 :
  116. 1590 [143]ark: blow.up.pit
  117. 1600 xc [178] rx
  118. 1610 yc [178] ry
  119. 1620 pd$ [178] bm$
  120. 1630 p1$ [178] b1$
  121. 1640 [141] 1740 : [143] draw a piece
  122. 1650 [141] 3160 : [143] explosion
  123. 1651 [141] 1670
  124. 1652 [142]
  125. 1665 :
  126. 1670 [143]ark: kill.robot
  127. 1680 rx(i)[178]0 : ry(i)[178]0
  128. 1690 lr[178]lr[171]1
  129. 1700 [139] pv[179][177]103 [167] [142]
  130. 1710 [153] [200](cd$,ry);
  131. 1720 [153] [163]rx[170]2) sp$ [199](19);
  132. 1730 [142]
  133. 1735 :
  134. 1740 [143]ark: draw.a.piece
  135. 1750 [153][199](19);
  136. 1760 [153] p1$;
  137. 1770 [139] ox[178]0 [175] oy[178]0 [167] [137] 1800
  138. 1780 [153] [200](cd$,oy);
  139. 1790 [153] [163]ox[170]2) sp$ [199](19);
  140. 1800 [153] [200](cd$,yc);
  141. 1810 [153] [163]xc[170]2) pd$ [199](19);
  142. 1820 [142]
  143. 1825 ::
  144. 1880 [143]ark: printline
  145. 1890 z$[178]se$ : [139] z$[178]"" [167] [142]
  146. 1900 z[178]cw%[171]1[171][185](0): [139] z[179]cw%[171]2 [137] 1920
  147. 1910 [139] [200](z$,1)[178]" " [167] z$[178][202](z$,2) : [137] 1910
  148. 1920 [139] [195](z$)[179][178]z [167] [153] z$; : [142]
  149. 1930 [139] z[179]2 [167] [153] : [137] 1900
  150. 1940 [129]z1[178]z[164]1[169][171]1:[139][202](z$,z1,1)[179][177]" "[167][130]z1
  151. 1950 [139]z1[178]0 [167] [153] : [137] 1900
  152. 1960 [153] [200](z$,z1);
  153. 1970 z$[178][202](z$,z1[170]1) : [137] 1900
  154. 1980 :
  155. 2010 [143]ark: wait-for-fire-button
  156. 2020 [153] [200](cd$,24);
  157. 2030 se$ [178] "(NULL)ress ascright$(NULL)val peek(NULL)(NULL)(NULL)(NULL)(NULL) when ready"
  158. 2035 [153][199](5); : [141] 3390
  159. 2040 se$ [178] "(NULL)ress asc8 for (NULL)p(NULL)ime"
  160. 2045 [153][199](13); : [141] 3390 : [153][199](19);
  161. 2050 js [178] [194](jp) [175] 16
  162. 2055 [161] kp$: [139] kp$[178][199](140) [167] 2760
  163. 2060 [139] js [178]16 [137] 2050
  164. 2070 [153] [200](cd$,24);
  165. 2080 [153]"                                      ";
  166. 2090 [142]
  167. 2095 :
  168. 2100 [143]ark: instructions
  169. 2110 [151] 53272,30 : [143] enable custom characters
  170. 2120 se$ [178] "val(NULL)lenatn(NULL)val asc(NULL)(NULL)(NULL) (NULL)left$val (NULL)right$(NULL)(NULL)val(NULL) (NULL)(NULL)peek(NULL)(NULL)(NULL)"
  171. 2140 [153]"load"[199](8)[199](11);
  172. 2150 [153] [199](5) [199](18);
  173. 2160 [141] 3390 : [143] print string in center
  174. 2170 [153] [199](158) [199](17)
  175. 2180 [153]"(NULL)ou are trying to escape from a pack of"
  176. 2190 [153]"nasty aliens, who have tossed you into"
  177. 2200 [153]"a prison compound surrounded by an elec-";
  178. 2210 [153]"trified fence.  str$eadly pits (";b2$;bc$;[199](158)") have"
  179. 2230 [153]"also been dug all over the prison yard."
  180. 2231 [153]"peekarriers (list"ba$"sys) are also scattered through-out the compound."
  181. 2235 [153]
  182. 2240 [153]"(NULL)owerful (but stupid) (NULL)obots (";r1$;rc$;[199](158);") patrol"
  183. 2250 [153]"the yard; they are programmed to destroy";
  184. 2260 [153]"you (";h1$;hc$;[199](158);
  185. 2270 [153]"), regardless of their own fate."
  186. 2280 [153]"(NULL)o survive, you must move";
  187. 2290 [153]" about so that the (NULL)obots blunder into";
  188. 2300 [153]" the pits and ex-plode.  ((NULL)he debris";
  189. 2310 [153]" then fills the pit"
  190. 2311 [153]"up!)  atnlso, hide behind the barriers"
  191. 2315 [153]"whenever you can."
  192. 2320 [153] : [153]
  193. 2330 [153]"   (NULL)se a joystick plugged into port #2"
  194. 2340 [153]"to control your movement.":[153]:[153]
  195. 2350 [141] 2010
  196. 2360 [153][199](147);
  197. 2370 [143]  gosub 2770 : rem get level of diff (dk)
  198. 2380 [153][199](147);
  199. 2390 [142]
  200. 2395 :
  201. 2400 [143]ark: you.escaped!!!
  202. 2410 [153] [200](cd$,19);
  203. 2420 [153][199](5);
  204. 2430 [153] "  (NULL)ou've destroyed all the robots!  "
  205. 2440 [153] "  (NULL)he electrified fence loses power..."
  206. 2450 [153] "  (NULL)ou make your escape!" : [153]:[153]
  207. 2460 [137] 2710
  208. 2465 :
  209. 2470 [143]ark: you.touched.a.fence
  210. 2480 [141] 3230
  211. 2490 [153] [200](cd$,19);
  212. 2500 [153][199](150);
  213. 2510 [153] "  atnaargh!  (NULL)hat fence was electrified!"
  214. 2520 [137] 2660
  215. 2525 :
  216. 2530 [143]ark: you.touched.a.pit
  217. 2540 [141] 3230
  218. 2550 [153] [200](cd$,19);
  219. 2560 [153][199](150);
  220. 2570 [153]  "      (NULL)oops!  (NULL)hat pit was deadly!"
  221. 2580 [137] 2660
  222. 2585 :
  223. 2590 [143]ark: they.caught.you.and.you're.dead
  224. 2600 [141] 3230
  225. 2610 [153] [200](cd$,19);
  226. 2620 [153][199](153);
  227. 2630 [153] " (NULL)he nasty alien robots";
  228. 2640 [153]" have recaptured  and microwaved you!!!" :[153]
  229. 2650 [137] 2660
  230. 2655 :
  231. 2660 [143]ark: rest-in-peace
  232. 2670 [153][199](158);
  233. 2680 [153][199](146);
  234. 2690 [153]:[153]"             (NULL