home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 231
/
231.d81
/
win_lose_draw
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
159 lines
5 dq=peek(186)
10 ifl=0thenl=1:load"sysplotterd.o",dq,1
20 poke55,0:poke56,32:clr
30 :
35 poke650,128
40 gosub 1000
45 j=56320
50 sys49158:rem clear hi-res
52 sys49161,16:rem color smear hi-res
54 sys49152: rem go to hi-res
56 sys49164,1: rem paint color
60 ms=0
65 xc=140:yc=30:xs=10:ys=4
70 sys49179,"score = 0 hi score = 1024896",8,176
72 sys49179,"f1/f7 aim, <space> shoots, <_> quits",8,184
80 gosub 10000 : rem draw target
82 ot=140
84 bx=140
86 gosub30000 : rem draw base
88 ot=bx
90 ifpeek(198)=0andpeek(j)=127then90
91 geti$:j%=peek(j)
92 if(i$="[133]"orj%=123)andbx>130thenbx=bx-1:goto86
94 if(i$="[136]"orj%=119)andbx<150thenbx=bx+1:goto86
96 ifi$="_"then59000
98 ifi$=" "orj%=111thengosub50000:gosub31000:gosub40000:goto86
100 goto86
999 end
1000 rem title screen
1010 print"[147][144]":poke53281,1:poke53280,5
1020 printspc(6)"[196]ispute?'s [199]azelle [208]resents:"
1030 printspc(10)"[215]in, [204]ose, or [196]raw"
1040 print" by [196]aniel [212]obias - [193]pr. 1, 1987"
1050 print" [195]opyright (c) 1987"
1060 print" [193]n interstellar shooting gallery"
1070 print"[213]se [198]1/[198]7 keys (or joystick in port #2)"
1075 print" to aim gun, and space bar (or [198][201][210][197])"
1080 print"to shoot. [212]ry to hit the flying saucer."
1082 :
1090 print"[201]f you score makes the top ten, you get"
1092 print"in the permanent high score list!"
1095 print""spc(9)"[208]ress any key to begin."
1097 poke198,0:wait198,1:poke198,0:return
10000 rem plot target
10010 sys49173,xc-xs,yc-ys,xc+xs,yc-ys
10020 sys49173,xc+xs,yc-ys,xc+(xs*1.333),yc
10030 sys49173,xc+(xs*1.333),yc,xc+(xs*1.333),yc+ys
10032 sys49173,xc+(xs*1.333),yc+ys,xc-(xs*1.333),yc+ys
10034 sys49173,xc-(xs*1.333),yc+ys,xc-(xs*1.333),yc
10036 sys49173,xc-(xs*1.333),yc,xc-xs,yc-ys
10040 y=yc+0.333*ys
10045 forx=xc-(.8*xs)toxc+(.8*xs)step.2*xs
10050 gosub20000
10060 next
10070 forx=xc-xstoxc+xsstepxs/10
10080 sys49173,x,yc+1.05*ys,x,yc+1.5*ys
10090 next
10092 return
20000 rem draw window
20010 sys49173,x,y,x+(xs/20),y+(ys/5)
20012 sys49173,x+(xs/20),y+(ys/5),x-(xs/20),y+(ys/5)
20014 sys49173,x-(xs/20),y+(ys/5),x,y
20020 return
30000 rem draw base
30010 :
30012 sys49176,140,159,ot,150
30014 sys49176,139,159,ot-1,150
30016 :
30017 sys49173,135,159,145,159
30020 sys49173,135,158,145,158
30030 sys49173,140,159,bx,150
30035 sys49173,139,159,bx-1,150
30040 return
31000 rem show bullet
31005 oy=149:ox=bx
31007 gosub 32000
31100 fory=sytotystep-1:poke54296,15:poke54296,0
31115 x=((tx-sx)/(ty-139))*(y-sy)+sx
31120 sys49170,ox,oy
31130 sys49167,x,y
31135 ox=x:oy=y
31140 next
31150 return
32000 rem go a litte ways straight...
32010 fory=149to120step-1
32020 x=((bx-140)/(-9))*(y-149)+bx:poke54296,15:poke54296,0
32030 sys49170,ox,oy
32035 sys49167,x,y
32040 ox=x:oy=y
32050 nexty
32060 sx=x:sy=y
32070 return
40000 rem score!
40005 ifabs(ms)thengosub63000:return
40006 gosub 62000
40007 fori=1to60:
40008 sys49167,xc+rnd(1)*2*xs-xs,yc+rnd(1)*2*ys-ys:next
40010 :
40015 sys49179," you have completed the first level.",1*8,1*8
40017 sys49179," now entering the second level...",1*8,2*8
40018 fordl=1to3000:next
40019 sys49158
40020 sys49179,"score = 1000 hi score = 1024896",8,176
40022 sys49179,"f1/f7 aim, <space> shoots, <_> quits",8,184
40025 ms=1:xc=140:yc=30:xs=60:ys=20
40030 gosub 10000:gosub 30000
40040 tx=279:ty=yc:return
50000 rem set target position
50010 ifabs(ms)then50030
50020 tx=xc:ty=yc:return
50030 ifbx<140thentx=1:ty=yc:return
50040 tx=279:ty=yc:return
59000 print"[147][144]";:sys49155:goto60010
59999 end
60000 d=peek(186):open1,d,15,"i0":n$="win/lose/draw"
60001 print#1,"s0:"+n$:close1:saven$,d:end
60010 print""spc(13)"[200]igh [211]cores:"
60020 print" ( 1 ) 1024896 [196][193][206]"
60022 print" ( 2 ) 998644 [202][215][205]"
60023 print" ( 3 ) 675221 [215][193][214]"
60024 print" ( 4 ) 216315 [203][201][205]"
60025 print" ( 5 ) 104702 [202][207][206]"
60026 print" ( 6 ) 66604 [211][201][206]"
60027 print" ( 7 ) 28045 [202][207][203]"
60028 print" ( 8 ) 9980 [196][193][206]"
60029 print" ( 9 ) 4139 [202][207][206]"
60030 print" (10 ) 1001 [196][193][206]"
60040 print" [217]our score: ";
60050 ifabs(ms)thenprint"1000":goto60060
60055 print"0"
60060 print"[193]nother game ([217]/[206])?"
60062 poke198,0:wait198,1:geti$
60063 ifi$<>"y"andi$<>"n"andi$<>"[217]"andi$<>"[206]"then60062
60064 ifi$="y"ori$="[217]"thenrun40
60065 :
61000 poke56,160:clr:dq=peek(186):load"connect",dq:end
61010 :
62000 rem sound for a hit
62010 s=54272
62020 poke s+24,15
62030 poke s+6,240
62040 poke s+4,17
62050 for a=1 to 10
62060 for x= 1 to 255 step 25
62070 poke s+1,x/2
62080 next x
62090 next a
62092 poke s+4,16
62094 return
63000 rem sound for a miss
63010 s=54272
63020 poke s+24,15
63030 poke s+6,240
63040 poke s+4,33
63050 pokes,4:pokes+1,4
63060 fordl=1to400:next
63070 poke s+4,32
63094 return