Adding sub explosions.

This commit is contained in:
Rob Greene 2018-07-14 16:48:12 -05:00
parent fde074ccdc
commit 53b8575d3b
2 changed files with 80 additions and 10 deletions

View File

@ -5,18 +5,20 @@
100 hgr:vtab 21
110 wl=40:ws=wl-3:wc=wl+2
110 hcolor=6:hplot 0,wl to 279,wl
110 hcolor=6:hplot 0,wl to 279,wl:hplot 0,159 to 279,159
120 hcolor=3
130 x=140:sd=0:s=sh
140 di=1:mm=5:dim dx(mm),dy(mm),ds(mm),ox(mm),oy(mm),os(mm)
150 for i=1 to mm:dx(i)=0:dy(i)=0:ds(i)=0:next i
160 bs=0:bx=0:by=0:bd=0
170 xs=0:xx=0:xy=0
200 xdraw s at x,ws:ox=x:os=s
210 if bx then xdraw bs at bx,by:cx=bx:cs=bs:cx=bx:cy=by
210 if bx then xdraw bs at bx,by:cs=bs:cx=bx:cy=by
220 ox(di)=dx(di):oy(di)=dy(di):os(di)=ds(di)
230 if dx(di) then xdraw ds(di) at dx(di),dy(di)
240 if xx then xdraw xs at xx,xy:zs=xs:zx=xx:zy=xy
300 ky=peek(-16384):if ky < 128 then 400
310 poke -16368,0
@ -32,22 +34,24 @@
430 goto 500
450 rr=rnd(1):if rr < 0.10 then 480
460 if rr > 0.20 then 500
470 bx=10:by=wl+10+rnd(1)*80:bd=1:bs=sb+1:goto 500
480 bx=270:by=wl+10*rnd(1)*80:bd=-1:bs=sb
470 bx=10:by=wl+10+rnd(1)*80:bd=2:bs=sb+1:goto 500
480 bx=270:by=wl+10+rnd(1)*80:bd=-2:bs=sb
500 x=x+sd
510 if x < 10 then x=10
520 if x > 270 then x=270
550 if xs then xs=xs+2:if xs >= sh then xx=0
600 if not dx(di) then 690
610 ds(di)=ds(di)+1:if ds(di) > dc+3 then ds(di)=dc
620 dy(di)=dy(di)+3:if dy(di) > 160 then dx(di)=0:dy(di)=0:ds(di)=0
620 dy(di)=dy(di)+5:if dy(di) > 155 then dx(di)=0:dy(di)=0:ds(di)=0
690 di=di+1:if di > mm then di = 1
700 if ox(di) then xdraw os(di) at ox(di),oy(di)
710 if cx then xdraw cs at cx,cy:if peek(234) then print "BOOM!":bx=0:cx=0
720 xdraw os at ox,ws
730 goto 200
700 if ox(di) then xdraw os(di) at ox(di),oy(di):if peek(234) then dx(di)=0:dy(di)=0:ds(di)=0
710 if cx then xdraw cs at cx,cy:a=cx:cx=0:if peek(234) then print "BOOM!":xs=cs+2:xx=a:xy=cy:bx=0
720 if zx then xdraw zs at zx,xy:zx=0
730 xdraw os at ox,ws
740 goto 200
49999 end
50000 $shape src="ships.st", poke=yes, init=yes, assign=(sb="sub-left", sh="ship-left", dc="depthcharge-1")

View File

@ -10,6 +10,72 @@
xxxxxxx*xxxxxxx
xx.xxxxxxxxxxx.
.bitmap sub-left-explosion-1
....xxxxx.......
.xxxx...xxxxxxxx
xx..........x..x
x......+.......x
xx..........x..x
.xxxxxxxxxxxxxxx
.bitmap sub-right-explosion-1
.......xxxxx....
xxxxxxxx...xxxx.
x..x..........xx
x.......+......x
x..x..........xx
xxxxxxxxxxxxxxx.
.bitmap sub-left-explosion-2
....xxx.xxx.......
.xx.x.....xxx.xxxx
xx...............x
x................x
........+.........
x................x
xx...............x
.xxx.xxxxxxxx.xxxx
.bitmap sub-right-explosion-2
.......xxx.xxx....
xxxx.xxx.....x.xx.
x...............xx
x................x
.........+........
x................x
x...............xx
xxxx.xxxxxxxx.xxx.
.bitmap sub-left-explosion-3
.....xx..xx..........
......xxxx......xx...
.x............xxx....
xx...................
.....................
...................xx
..........+........x.
...................xx
.....................
xx...................
.x............xxx....
......xxxx......xx...
.....xx..xx..........
.bitmap sub-right-explosion-3
..........xx..xx.....
...xx......xxxx......
....xxx............x.
...................xx
.....................
xx...................
.x........+..........
xx...................
.....................
...................xx
....xxx............x.
...xx......xxxx......
..........xx..xx.....
.bitmap ship-left
.....xxxx......
.....xxxx......