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