home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 65 / 065.d81 / p-cavern (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  206 lines

  1. 100 rem    the challenge of pegasus
  2. 110 rem       the cavern of doom
  3. 120 :
  4. 130 sys57812"bumblebee.mus",8,0:poke780,.:   poke781,.:poke782,80:sys65493
  5. 140 :
  6. 150 sys57812"sid.obj.64",8,0:poke780,.:       poke781,.:poke782,192:sys65493
  7. 160 :
  8. 170 sys57812"my.spr",8,0:poke780,.:          poke781,64:poke782,53:sys65493
  9. 180 :
  10. 190 sys57812"cave.font",8,0:poke780,.:       poke781,.:poke782,56:sys65493
  11. 200 :
  12. 210 sys57812"cave.o",8,0:poke780,.:       poke781,.:poke782,64:sys65493
  13. 220 :
  14. 230 :
  15. 240 poke53272,30:rem font @ $3800
  16. 250 :
  17. 260 v=53248:gosub1840:rem choose level
  18. 265 s1=54273:v1=53294:s2=54287
  19. 270 :
  20. 280 dim c(3):c(1)=15:c(2)=12:c(3)=11
  21. 290 :
  22. 300 sc=0 : rem score
  23. 310 :
  24. 320 sys49615 : rem 'hook'
  25. 330 poke781,.:poke782,80:sys49664:poke       49152,7 : rem 'play'
  26. 340 :
  27. 350 :
  28. 360 print"[147][159] [185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
  29. 370 print" [129]miles  energy   cave of       crystals"
  30. 380 print"[159] [184][184][184][184][184]  [184][184][184][184][184][184]    [129]doom         [159][184][184][184][184][184][184][184][184]"
  31. 390 printtab(17)"[159][184][184][184][184][184][184][184][184]"
  32. 400 print"                                       "
  33. 410 printtab(2)"   [146]         [146]        [146]     [146]     [146]      "
  34. 420 printtab(2)"   [146]       [146]         [146]     [146]     [146]       "
  35. 430 printtab(3)" [146]       [146]          [146]     [146]     [146]       "
  36. 440 printtab(3)" [146]       [146][146]          [146]    [161]    [161]       "
  37. 450 printtab(3)" [146]      [161]          [146]         [161]       "
  38. 460 printtab(3)"[161]      [161]         [146]          [180]       "
  39. 470 printtab(3)"[161]                [146]                 [182]"
  40. 480 printtab(3)"[161]                [146]                 [182]"
  41. 490 printtab(3)"[161]               [181]                 [182]"
  42. 500 print
  43. 510 print:printtab(11)"[181]"
  44. 520 printtab(11)"[181]                    [182]"
  45. 530 printtab(2)"[161]         [146]            [181]       [182] "
  46. 540 printtab(2)"[161]         [146]             [146]        "
  47. 550 printtab(2)" [146]          [146]            [146]        "
  48. 560 printtab(2)" [146]          [146]            [146]        "
  49. 570 printtab(2)" [146]           [146]            [146]       "
  50. 580 print"                                       "
  51. 590 :
  52. 600 forx=2040to2047:readd:pokex,d:nextx
  53. 610 :
  54. 620 reado,d:ifo>-1 then pokev+o,d:           goto620
  55. 630 yp=161
  56. 640 :
  57. 650 forx=17152to17168:readd:pokex,d:          nextx
  58. 660 :
  59. 670 restore
  60. 680 :
  61. 690 print" "sc"     "sh:print""tab(33)m
  62. 700 :
  63. 710 rem ------------------------------
  64. 720 :
  65. 730 rem  clear sprite collision reg's
  66. 740 :
  67. 750 ws=peek(v+30):wc=peek(v+31)
  68. 760 :
  69. 770 poke16402,220: rem sprite page #
  70. 780 poke16403,7  : rem sprite #7
  71. 790 poke16404,.  : rem set-up music
  72. 800 poke16405,80 : rem   pntrs for ml
  73. 810 poke16406,7  : rem init ml indexl
  74. 820 :
  75. 830 rem ------------------------------
  76. 840 :
  77. 850 poke17152,127:sys 16384:rem setirq
  78. 860 :
  79. 870 :
  80. 880 rem --- this is the main loop! ---
  81. 890 :
  82. 900 sys 16393  :  rem poll joystick
  83. 910 ifpeek(16407)then1060
  84. 920 :
  85. 930 sys 16390  :  rem 'scroll'
  86. 940 :
  87. 950 sys 16399  : rem collision detect
  88. 960 ifpeek(16408)then1330
  89. 970 :
  90. 980 sc=sc+1:print" "sc:ifsc>mi then      goto1740
  91. 990 if sc>400 then sys 16390
  92. 995 if sc>800 then sys 16390
  93. 1000 goto900
  94. 1010 :
  95. 1020 :
  96. 1030 rem ----  'fire' was pressed  ----
  97. 1040 :
  98. 1050 :
  99. 1060 x=226:y=peek(v+15)
  100. 1070 pokev+12,x:pokev+13,y:pokev+21,255
  101. 1080 poke17152,64
  102. 1090 ifpeek(v+30)>64then1160
  103. 1100 x=x-8:pokev+12,x:ifx>32then1090
  104. 1110 :
  105. 1120 poke17152,255:pokev+21,191
  106. 1130 m=m-1:print""tab(33)m
  107. 1140 goto900
  108. 1150 :
  109. 1160 q=213 : pokev+21,191
  110. 1170 :
  111. 1180 rem ----  make 'boing' sound  ----
  112. 1190 :
  113. 1200 poke49152,.:sys16396:poke54296,15
  114. 1210 poke54277,8:poke54278,255:poke54276,23:ff=202
  115. 1220 forz=1to8:fw=30:q=q+1:ifq=217thenq=213
  116. 1230 poke2040,q:poke2041,q
  117. 1240 pokes1,ff:fory=1to10:pokes2,fw:fw=fw*1.01:nexty:ff=ff-8:nextz
  118. 1250 sc=sc+150:print" "sc:ifsc>mithen1740
  119. 1260 m=m-1:print""tab(33)m
  120. 1270 pokev+1,52:pokev+3,220:ws=peek(v+30):poke17152,255:sys16396:goto900
  121. 1280 :
  122. 1290 rem ------------------------------
  123. 1300 rem -- sprite collision routine --
  124. 1310 rem ------------------------------
  125. 1320 :
  126. 1330 poke17152,.
  127. 1340 :
  128. 1350 poke49152,.:sys16396
  129. 1360 poke54296,15:poke54277,8:poke54278,255:poke54276,23:f2=7.745
  130. 1370 fort=1to3:pokev1,c(t):pokes2,f2:forf1=80to40step-1:pokes1,f1
  131. 1380 f2=f2-.025:nextf1:nextt:poke54278,15
  132. 1390 sys16396 : sys16387
  133. 1400 sh=sh-1:ifsh=0then1450
  134. 1410 pokev+21,63:fort=0to500:next:            pokev+21,.:pokev+16,.:goto360
  135. 1420 :
  136. 1430 rem ---- end of game routine ----
  137. 1440 :
  138. 1450 poke49152,.:sys49897:sys49935
  139. 1460 print"[147][159]":pokev+21,.
  140. 1470 print"[154]       your flying days are over"
  141. 1480 print"      after a flight of"sc"[154]miles"
  142. 1490 print"    do you want to play again? (y[154]/n[154])"
  143. 1500 poke198,.
  144. 1510 geta$:ifa$=""then1510
  145. 1520 ifa$="n"then1620
  146. 1530 ifa$<>"y"then1510
  147. 1540 :
  148. 1550 pokev+21,.:poke17152,.:print"[147]"
  149. 1560 pokev+16,.:clr
  150. 1570 goto260
  151. 1580 :
  152. 1590 :
  153. 1600 rem    connect to loadstar
  154. 1610 :
  155. 1620 print"[147][144]":pokev+21,.:pokev+16,.:         pokev+23,.:pokev+29,.
  156. 1630 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  157. 1640 poke53272,21:ifer<>63thenprint"[147]":      end
  158. 1650 a$="hello connect":q$=chr$(34)
  159. 1660 print"[144][147]load"q$a$q$",8"
  160. 1670 print"run":poke631,13:              poke632,13:poke198,2:end
  161. 1680 :
  162. 1690 :
  163. 1700 rem -----------------------------
  164. 1710 rem --- off to mount olympus! ---
  165. 1720 rem -----------------------------
  166. 1730 :
  167. 1740 sys 16387:pokev+21,.:poke53272,21
  168. 1745 poke49152,.:sys49897:sys49935
  169. 1750 rem   sys16396 : rem my 'hush'
  170. 1760 printchr$(147):print:print
  171. 1770 print"[144]load"chr$(34)"p-olympus"chr$(34)",8":print:print:print:print
  172. 1780 print"run":print"[154]and now to mount olympus....[144]"
  173. 1790 printchr$(19):poke198,2:poke631,13:      poke632,13:end
  174. 1800 :
  175. 1810 :
  176. 1820 rem --- choose level of play ----
  177. 1830 :
  178. 1840 poke53280,.:poke53281,.
  179. 1850 print"[147][154]"tab(8)"pick your level of play"
  180. 1860 printtab(8)"[184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]":print
  181. 1870 print"1. [154]beginner (very little flight time)"
  182. 1880 print"2. [154]intermediate (flies most weekends)"
  183. 1890 print"3. [154]expert (a flying horse for years)"
  184. 1900 printtab(12)"press 1, 2 or 3"
  185. 1910 poke198,.
  186. 1920 geth$:ifh$=""then1920
  187. 1930 ifh$<"1"orh$>"3"then1920
  188. 1940 h=val(h$):mi=h*500:m=11-2*h:sh=m
  189. 1950 return
  190. 1960 :
  191. 1970 :
  192. 1980 :
  193. 1990 data 213,213,217,217,218,218
  194. 2000 data 219,220
  195. 2010 :
  196. 2020 data 0,40,1,154,2,75,3,220,4,40
  197. 2030 data 5,82,6,200,7,82,8,46,9,196
  198. 2040 data 10,230,11,196,14,246,15,161
  199. 2050 data 16,0,23,60,29,60,27,63,39,3
  200. 2060 data 40,10,41,13,42,13,43,13
  201. 2070 data 44,13,45,7,46,1,21,191,-1,-1
  202. 2080 :
  203. 2090 data 0,1,255,2,1,2,0,2,0,2,0,2,0
  204. 2100 data 0,0,0,0
  205. 10000 open15,8,15,"s0:p-cavern":close15:save"p-cavern",8:end
  206.