home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 180 / 180.d81 / castle (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  155 lines

  1. 8 dv=peek(186):ifdv<8thendv=8
  2. 10 rem    escape route c64 sept.1992
  3. 12 rem    castle - jc hilty
  4. 14 open3,dv,3,"stats,s,r":input#3,dy:input#3,ms:input#3,sc:input#3,ft:close3
  5. 20 sys57812"escape.sp2",dv,1:sys62631
  6. 22 dimp%(18,4),q%(8,4),nx%(18,4),ox%(8,4)
  7. 24 forx=1to18:fory=1to4:readp%(x,y):nexty:nextx
  8. 26 forx=1to8:fory=1to4:readq%(x,y):nexty:nextx
  9. 28 forx=1to18:fory=1to4:readnx%(x,y):nexty:nextx
  10. 30 forx=1to8:fory=1to4:readox%(x,y):nexty:nextx
  11. 31 v=53248:s=54272:le=0
  12. 32 sys49152,"pic8",40960,24576:sys860:tp=35:ys=20
  13. 34 sys16439,1,6,20,"[197]ric     ********************"
  14. 35 sys16439,6,6,22,"[200]enchman ********************"
  15. 36 gosub1000
  16. 99 rem    main loop
  17. 100 ifys<1then150
  18. 101 ifcs<1then800
  19. 102 fb=-((peek(56320)and16)=0):iffb=1then500
  20. 103 jy=peek(56320)and15
  21. 104 ifjy=14then510
  22. 105 ifjy=13then515
  23. 106 ifjy=7then520
  24. 107 ifjy=11then525
  25. 108 ifjy=6then530
  26. 109 ifjy=10then535
  27. 110 ifjy=9then540
  28. 112 ifjy=5then545
  29. 114 ifjj=1then252
  30. 130 ifpeek(v)<peek(v+2)thenpoke24569,46:do=1
  31. 132 ifpeek(v)>peek(v+2)thenpoke24569,24:do=0
  32. 134 ifpeek(v)<peek(v+2)andpeek(v+2)-peek(v)>24thenm2=3:goto250
  33. 136 ifpeek(v)>peek(v+2)andpeek(v)-peek(v+2)>24thenm2=1:goto250
  34. 138 z=int(rnd(3)*2)+1:onzgosub600,610:k2=1:goto250
  35. 150 poke24568,13
  36. 151 sys16439,7,6,23," [199]ood try, [197]ric.":fort=0to1000:next:pokev+21,0
  37. 152 ifms<1thena$="win":gosub9000:goto2000
  38. 154 dy=dy+1:ifdy=22thena$="lose":gosub9000:goto2000
  39. 156 a$="main":gosub9000:goto2000
  40. 169 rem    hit sound
  41. 170 forx=0to24:pokes+x,0:next:pokes+1,40:pokes+5,18:pokes+24,15:pokes,240
  42. 172 pokes+4,129:return
  43. 199 rem    framing animation
  44. 200 nf=1
  45. 202 poke24568,p%(m,nf):pokev,peek(v)+nx%(m,nf)
  46. 204 fort=0to10:next
  47. 206 nf=nf+1:ifnf=5thenk=0:k1=0:goto130
  48. 207 ifnf=2andjj=1then300
  49. 208 ifnf=3thengosub410
  50. 210 goto202
  51. 250 of=1:jj=1
  52. 252 poke24569,q%(m2,of):pokev+2,peek(v+2)+ox%(m2,of)
  53. 254 fort=0to10:next
  54. 256 of=of+1:ifof=2then102
  55. 257 ifof=5thenjj=0:k2=0:goto100
  56. 258 ifof=3andk2=1thenys=ys-1:tp=tp-1:gosub170:sys16439,1,tp,20," "
  57. 259 goto252
  58. 300 poke24569,q%(m2,of):pokev+2,peek(v+2)+ox%(m2,of)
  59. 302 poke24568,p%(m,nf):pokev,peek(v)+nx%(m,nf):fort=0to10:next
  60. 303 ifnf=2thengosub400:gosub410
  61. 304 nf=nf+1:of=of+1:ifnf=5thenjj=0:k=0:k2=0:k1=0:goto100
  62. 305 goto300
  63. 400 ifk=0andk2=1thenys=ys-1:tp=tp-1:gosub170:sys16439,1,tp,20," "
  64. 404 return
  65. 410 ifk1=0thenreturn
  66. 411 ifpeek(v)<peek(v+2)andpeek(v+2)-peek(v)<25anddn=0then420
  67. 412 ifpeek(v)>peek(v+2)andpeek(v)-peek(v+2)<25anddn=1then420
  68. 414 return
  69. 420 cs=cs-1:tc=tc-1:gosub170
  70. 421 sys16439,1,tc,22," ":return
  71. 499 rem    change directions
  72. 500 ifdn=0thendn=1:poke24568,32:goto103
  73. 502 ifdn=1thendn=0:poke24568,10:goto103
  74. 509 rem    jump
  75. 510 ifdn=0thenm=11:k=1:goto200
  76. 512 ifdn=1thenm=12:k=1:goto200
  77. 514 rem    duck
  78. 515 ifdn=0thenm=13:k=1:goto200
  79. 516 ifdn=1thenm=14:k=1:goto200
  80. 519 rem    walk right
  81. 520 ifpeek(v)>234then130
  82. 522 ifdn=0thenm=1:goto200
  83. 523 ifdn=1thenm=2:goto200
  84. 524 rem    walk left
  85. 525 ifpeek(v)<76then130
  86. 526 ifdn=0thenm=4:goto200
  87. 527 ifdn=1thenm=3:goto200
  88. 529 rem    high kick
  89. 530 ifdn=0thenm=5:k1=1:goto200
  90. 531 ifdn=1thenm=6:k1=1:goto200
  91. 534 rem    low kick
  92. 535 ifdn=0thenm=9:k1=1:goto200
  93. 536 ifdn=1thenm=10:k1=1:goto200
  94. 539 rem    punch
  95. 540 ifdn=0thenm=7:k1=1:goto200
  96. 541 ifdn=1thenm=8:k1=1:goto200
  97. 544 rem    roll
  98. 545 ifdn=0andpeek(v)<218thenm=15:k=1:goto200
  99. 546 ifdn=1andpeek(v)>092thenm=17:k=1:goto200
  100. 547 goto130
  101. 600 ifdo=1thenm2=6:return
  102. 602 m2=5:return
  103. 610 ifdo=1thenm2=8:return
  104. 612 m2=7:return
  105. 800 le=le+1:poke24569,43:sc=sc+150:ms=ms-100
  106. 801 ifle=1then806
  107. 802 ifle=2then810
  108. 803 ifle=3then820
  109. 804 ifle=4then830
  110. 805 ifle=5then1800
  111. 806 sys16439,7,6,23,"so far so good , [197]ric.":fort=0to4000:next
  112. 807 pokev+21,0:ys=15:tp=30:sys16439,7,6,23,"                              "
  113. 808 sys16439,1,6,20,"[197]ric     ***************     "
  114. 809 sys16439,6,6,22,"[200]enchman ********************":goto36
  115. 810 sys16439,7,6,23,"to the clue room, [205]r. [200]awthorne":fort=0to4000:next
  116. 811 pokev+21,0
  117. 812 sys49152,"pic9",40960,24576:sys860
  118. 813 sys16439,1,6,20,"[197]ric     **********"
  119. 814 sys16439,6,6,22,"[200]enchman ********************"
  120. 815 ys=10:tp=25:goto36
  121. 820 sys16439,7,6,23,"the henchmen are stronger....":fort=0to4000:next
  122. 822 pokev+21,0:ys=08:tp=23:sys16439,7,6,23,"                              "
  123. 824 sys16439,1,6,20,"[197]ric     ********            "
  124. 825 sys16439,6,6,22,"[200]enchman ********************":goto36
  125. 830 sys16439,7,6,23,"[206]ow the [205]aster [200]enchman...":fort=0to4000:next
  126. 832 pokev+21,0:ys=05:tp=20:sys16439,7,6,23,"                              "
  127. 834 sys16439,1,6,20,"[197]ric     *****               "
  128. 835 sys16439,6,6,22,"[200]enchman ********************":goto36
  129. 1000 poke24568,10:poke24569,46:pokev+28,3:pokev+37,10:pokev+38,0:pokev+23,3
  130. 1002 pokev+39,7:pokev+40,14:pokev,60:pokev+1,150:pokev+2,250:pokev+3,150
  131. 1004 pokev+29,3:pokev+21,3:xn=60:dn=0:do=1:jj=0:cs=20:tc=35:k=0:k1=0:k2=0
  132. 1005 return
  133. 1800 sys16439,7,6,23,"[197]xcellent work , [197]ric.":fort=0to4000:next:pokev+21,0
  134. 1802 ifms<1thena$="win":gosub9000:goto2000
  135. 1804 dy=dy+1:ifdy=22thena$="lose":gosub9000:goto2000
  136. 1806 a$="main":gosub9000:goto2000
  137. 2000 poke56576,(peek(56576)and252)or3:poke53265,27:poke53270,200
  138. 2002 print"[147]":poke53272,21:poke53281,0:poke53280,0:q$=chr$(34)
  139. 2006 print"[144][147]load"q$a$q$","dv:print"run":poke631,13:poke632,13:poke198,2
  140. 2008 end
  141. 5000 data 11,10,11,10,33,32,33,32,33,32,33,32,11,10,11,10,12,18,12,10
  142. 5002 data 34,40,34,32,14,15,14,10,36,37,36,32,16,17,16,10,38,39,38,32
  143. 5004 data 19,19,19,10,41,41,41,32,20,20,20,10,42,42,42,32,22,23,22,10
  144. 5006 data 44,45,44,32,44,45,44,32,22,23,22,10
  145. 5008 data 25,24,25,24,47,46,47,46,47,46,47,46,25,24,25,24,26,27,26,24
  146. 5010 data 48,49,48,46,28,29,28,24,50,51,50,46
  147. 5012 data 4,4,4,4,4,4,4,4,-4,-4,-4,-4,-4,-4,-4,-4,0,0,0,0,0,0,0,0,0,0,0,0
  148. 5014 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  149. 5016 data 8,8,8,8,8,8,8,8,-8,-8,-8,-8,-8,-8,-8,-8
  150. 5018 data 4,4,4,4,4,4,4,4,-4,-4,-4,-4,-4,-4,-4,-4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  151. 5020 data 0
  152. 9000 open3,dv,3,"@0:stats,s,w":print#3,dy:print#3,ms:print#3,sc:print#3,ft
  153. 9002 close3:return
  154. 10000 d=peek(186):n$="0:castle":open15,d,15,"s"+n$:close15:saven$,d:end
  155.