09-07-2022, 11:23 PM
Another update: added some indicators to (maybe) help pilot the ship. And a fancy intro when starting the game.
Code: (Select All)
'Space Lander
'james2464
'Sept 2022
Dim scx, scy As Integer
'screen size
scx = 1100 ' 640 min --- 1600 max made for 1100
scy = 600 ' 480 min --- 700 max made for 600
Screen _NewImage(scx, scy, 32)
Randomize Timer
Const PI = 3.141592654#
Dim thrust&
thrust& = _SndOpen("thrustsnd.ogg")
Dim snap&, bgsnap&
snap& = _NewImage(60, 60, 32)
bgsnap& = _NewImage(scx + 1, scy + 1, 32)
Dim Shared c0(100) As Long
c0(0) = _RGB(0, 0, 0)
c0(1) = _RGBA(255, 255, 255, 150)
c0(2) = _RGB(255, 0, 0)
c0(3) = _RGB(150, 150, 255)
c0(4) = _RGB(0, 200, 50)
c0(5) = _RGB(105, 100, 95)
c0(6) = _RGB(55, 50, 45)
c0(7) = _RGB(255, 50, 50)
c0(8) = _RGB(125, 125, 200)
c0(9) = _RGB(50, 150, 255)
c0(10) = _RGB(255, 200, 125)
c0(11) = _RGB(23, 20, 17)
c0(12) = _RGBA(6, 3, 0, 100) 'terrain texture
c0(14) = _RGBA(255, 255, 255, 50)
c0(15) = _RGBA(255, 255, 255, 250)
c0(16) = _RGB(150, 150, 150)
c0(17) = _RGBA(0, 255, 0, 90)
c0(18) = _RGB(15, 15, 15)
c0(20) = _RGB(120, 120, 170) 'ship
c0(21) = _RGB(150, 150, 200) 'ship
c0(22) = _RGB(170, 170, 220) 'ship
c0(23) = _RGB(180, 180, 230) 'ship
c0(30) = _RGBA32(255, 255, 150, 160) 'ship exhaust
c0(31) = _RGBA32(255, 255, 150, 80) 'ship exhaust
c0(32) = _RGBA32(255, 255, 150, 40) 'ship exhaust
c0(33) = _RGBA32(255, 255, 150, 20) 'ship exhaust
c0(34) = _RGBA32(255, 220, 0, 200) 'ship exhaust
c0(35) = _RGBA32(255, 220, 0, 100) 'ship exhaust
c0(36) = _RGBA32(255, 220, 0, 70) 'ship exhaust
c0(37) = _RGBA32(255, 220, 0, 40) 'ship exhaust
c0(38) = _RGBA32(255, 220, 0, 10) 'ship exhaust
c0(39) = _RGBA32(255, 220, 0, 0) 'ship exhaust
Dim xx, yy
xx = scx / 2
yy = scy / 2
Type BB
live As Integer
x As Single
y As Single
xv As Single
yv As Single
age As Integer
rad As Integer
spd As Single
colour As Integer
End Type
Dim Shared bnb(900) As BB
Type landingpad
x1 As Single
y1 As Single
x2 As Single
y2 As Single
colour As Integer
count As Integer
End Type
Dim Shared pad(100) As landingpad
Dim Shared j
Cls
'Color , &HFF000000 '= black background
j = 1
bnb(j).x = xx
bnb(j).y = yy
drawship j, c0, bnb
Line (bnb(j).x - 1, bnb(j).y - 8)-(bnb(j).x + 1, bnb(j).y - 6), c0(9), BF
_PutImage (0, 0), 0, snap&, (bnb(j).x - 30, bnb(j).y - 30)-(bnb(j).x + 30, bnb(j).y + 30)
_ClearColor &HFF000000, snap&
Cls
'add stars
For tt = 1 To 2
For tx = 1 To scx
For ty = 1 To scy
ttt = Int(Rnd * 1999)
If ttt > 1994 Then
c0(99) = Point(tx, ty)
If c0(99) = c0(0) Then
PSet (tx, ty), c0(14)
If ttt > 1997 Then
PSet (tx, ty), c0(1)
End If
xl = Int(Rnd * 100)
If xl > 98 Then
PSet (tx, ty), c0(15)
PSet (tx + 1, ty), c0(1)
PSet (tx, ty - 1), c0(1)
PSet (tx - 1, ty), c0(1)
PSet (tx, ty + 1), c0(1)
End If
End If
End If
Next ty
Next tx
Next tt
_PutImage (1, 1)-(scx - 1, scy - 1), 0, bgsnap&, (1, 1)-(scx - 1, scy - 1)
'rotate ship
Cls
flag = 0
rad = (xx * .9)
ds = .5 'step interval
si = 40 'size of image
sc = 15 'scale
dv = .020
df = 9000
flog = 2
If flog > 1 Then
_AutoDisplay
_Limit 30
For j = 1 To 90 Step ds
k = rad * (Cos(j * (PI / 180)))
sz = si + ((Sqr(rad ^ 2 - k ^ 2)) / sc)
_Display
_PutImage (0, 0)-(scx, scy), bgsnap&, 0 'replace screen background only
_PutImage (xx + k - sz, yy - sz)-(xx + k + sz, yy + sz), snap&, 0
d2 = sz / df
_Delay dv - d2
Next j
_AutoDisplay
For j = 90 To 1 Step -ds
k = rad * (Cos(j * (PI / 180)))
sz = si + ((Sqr(rad ^ 2 - k ^ 2)) / sc)
_Display
_PutImage (0, 0)-(scx, scy), bgsnap&, 0 'replace screen background only
_PutImage (xx - k - sz, yy - sz)-(xx - k + sz, yy + sz), snap&, 0
d2 = sz / df
_Delay dv - d2
Next j
_AutoDisplay
For j = 1 To 90 Step ds
k = rad * (Cos(j * (PI / 180)))
sz = si - ((Sqr(rad ^ 2 - k ^ 2)) / sc)
_Display
_PutImage (0, 0)-(scx, scy), bgsnap&, 0 'replace screen background only
_PutImage (xx - k - sz, yy - sz)-(xx - k + sz, yy + sz), snap&, 0
d2 = sz / df
_Delay dv + d2
Next j
ds = 3
_AutoDisplay
For j = xx To scx Step ds
_Display
sz = sz * .99
_PutImage (0, 0)-(scx, scy), bgsnap&, 0 'replace screen background only
_PutImage (j - k - sz, yy - sz)-(j - k + sz, yy + sz), snap&, 0
Next j
End If
_AutoDisplay
'display title
x77 = xx
y77 = yy - 35
'---- SPACE horizontal
Line (x77 - 100, y77 - 30)-(x77 - 70, y77 - 28), c0(9), BF
Line (x77 - 105, y77 - 1)-(x77 - 75, y77 + 1), c0(9), BF
Line (x77 - 110, y77 + 30)-(x77 - 80, y77 + 28), c0(9), BF
'--
Line (x77 - 60, y77 - 30)-(x77 - 30, y77 - 28), c0(9), BF
Line (x77 - 65, y77 - 1)-(x77 - 35, y77 + 1), c0(9), BF
'--
Line (x77 - 25, y77 - 1)-(x77 + 5, y77 + 1), c0(9), BF
'--
Line (x77 + 20, y77 - 30)-(x77 + 50, y77 - 28), c0(9), BF
Line (x77 + 10, y77 + 30)-(x77 + 40, y77 + 28), c0(9), BF
'--
Line (x77 + 60, y77 - 30)-(x77 + 90, y77 - 28), c0(9), BF
Line (x77 + 55, y77 - 1)-(x77 + 85, y77 + 1), c0(9), BF
Line (x77 + 50, y77 + 30)-(x77 + 80, y77 + 28), c0(9), BF
'---- SPACE vertical
Line (x77 - 100, y77 - 30)-(x77 - 105, y77 + 1), c0(9)
Line (x77 - 98, y77 - 30)-(x77 - 103, y77 + 1), c0(9)
Line (x77 - 75, y77 + 1)-(x77 - 80, y77 + 30), c0(9)
Line (x77 - 73, y77 + 1)-(x77 - 78, y77 + 28), c0(9)
'--
Line (x77 - 60, y77 - 30)-(x77 - 70, y77 + 30), c0(9)
Line (x77 - 58, y77 - 30)-(x77 - 68, y77 + 30), c0(9)
Line (x77 - 70, y77 - 30)-(x77 - 68, y77 - 30), c0(9)
Line (x77 - 30, y77 - 30)-(x77 - 35, y77 - 1), c0(9)
Line (x77 - 28, y77 - 30)-(x77 - 33, y77 - 1), c0(9)
'--
Line (x77 - 6, y77 - 30)-(x77 - 4, y77 - 30), c0(9)
Line (x77 - 25, y77 - 1)-(x77 - 6, y77 - 30), c0(9)
Line (x77 - 23, y77 - 1)-(x77 - 5, y77 - 28), c0(9)
Line (x77 - 4, y77 - 30)-(x77 + 5, y77 - 1), c0(9)
Line (x77 - 5, y77 - 28)-(x77 + 3, y77 - 1), c0(9)
Line (x77 - 25, y77 + 1)-(x77 - 30, y77 + 30), c0(9)
Line (x77 - 23, y77 + 1)-(x77 - 28, y77 + 30), c0(9)
Line (x77 + 5, y77 - 1)-(x77 + 0, y77 + 30), c0(9)
Line (x77 + 3, y77 - 1)-(x77 - 2, y77 + 30), c0(9)
Line (x77 - 30, y77 + 30)-(x77 - 28, y77 + 30), c0(9)
Line (x77 - 0, y77 + 30)-(x77 - 2, y77 + 30), c0(9)
'--
Line (x77 + 20, y77 - 28)-(x77 + 10, y77 + 28), c0(9)
Line (x77 + 22, y77 - 28)-(x77 + 12, y77 + 28), c0(9)
'--
Line (x77 + 60, y77 - 28)-(x77 + 50, y77 + 28), c0(9)
Line (x77 + 62, y77 - 28)-(x77 + 52, y77 + 28), c0(9)
'---- LANDER horizontal
Line (x77 - 120, y77 + 90)-(x77 - 95, y77 + 88), c0(9), BF
'--
Line (x77 - 80, y77 + 66)-(x77 - 55, y77 + 64), c0(9), BF
'--
Line (x77 + 30, y77 + 40)-(x77 + 55, y77 + 42), c0(9), BF
Line (x77 + 25, y77 + 64)-(x77 + 50, y77 + 66), c0(9), BF
Line (x77 + 20, y77 + 90)-(x77 + 45, y77 + 88), c0(9), BF
'--
Line (x77 + 65, y77 + 40)-(x77 + 90, y77 + 42), c0(9), BF
Line (x77 + 60, y77 + 64)-(x77 + 85, y77 + 66), c0(9), BF
'---- LANDER vertical
Line (x77 - 110, y77 + 40)-(x77 - 120, y77 + 90), c0(9)
Line (x77 - 108, y77 + 40)-(x77 - 118, y77 + 90), c0(9)
Line (x77 - 110, y77 + 40)-(x77 - 108, y77 + 40), c0(9)
'--
Line (x77 - 63, y77 + 40)-(x77 - 61, y77 + 40), c0(9)
Line (x77 - 80, y77 + 64)-(x77 - 63, y77 + 40), c0(9)
Line (x77 - 78, y77 + 64)-(x77 - 62, y77 + 42), c0(9)
Line (x77 - 61, y77 + 40)-(x77 - 55, y77 + 64), c0(9)
Line (x77 - 62, y77 + 42)-(x77 - 57, y77 + 64), c0(9)
Line (x77 - 80, y77 + 66)-(x77 - 85, y77 + 90), c0(9)
Line (x77 - 78, y77 + 66)-(x77 - 83, y77 + 90), c0(9)
Line (x77 - 85, y77 + 90)-(x77 - 83, y77 + 90), c0(9)
Line (x77 - 57, y77 + 66)-(x77 - 62, y77 + 90), c0(9)
Line (x77 - 55, y77 + 66)-(x77 - 60, y77 + 90), c0(9)
Line (x77 - 62, y77 + 90)-(x77 - 60, y77 + 90), c0(9)
'--
Line (x77 - 40, y77 + 40)-(x77 - 50, y77 + 90), c0(9)
Line (x77 - 38, y77 + 44)-(x77 - 48, y77 + 90), c0(9)
Line (x77 - 15, y77 + 40)-(x77 - 25, y77 + 90), c0(9)
Line (x77 - 17, y77 + 40)-(x77 - 27, y77 + 86), c0(9)
Line (x77 - 40, y77 + 40)-(x77 - 38, y77 + 40), c0(9)
Line (x77 - 38, y77 + 40)-(x77 - 27, y77 + 86), c0(9)
Line (x77 - 38, y77 + 48)-(x77 - 28, y77 + 90), c0(9)
Line (x77 - 50, y77 + 90)-(x77 - 48, y77 + 90), c0(9)
Line (x77 - 27, y77 + 90)-(x77 - 25, y77 + 90), c0(9)
Line (x77 - 17, y77 + 40)-(x77 - 15, y77 + 40), c0(9)
'--
Line (x77 - 5, y77 + 40)-(x77 - 15, y77 + 90), c0(9)
Line (x77 - 3, y77 + 45)-(x77 - 13, y77 + 87), c0(9)
Line (x77 - 5, y77 + 40)-(x77 - 3, y77 + 40), c0(9)
Line (x77 - 3, y77 + 40)-(x77 + 15, y77 + 65), c0(9)
Line (x77 - 13, y77 + 90)-(x77 + 15, y77 + 65), c0(9)
Line (x77 - 13, y77 + 87)-(x77 + 12, y77 + 65), c0(9)
Line (x77 - 3, y77 + 45)-(x77 + 12, y77 + 65), c0(9)
'--
Line (x77 + 30, y77 + 40)-(x77 + 20, y77 + 90), c0(9)
Line (x77 + 32, y77 + 42)-(x77 + 22, y77 + 88), c0(9)
'--
Line (x77 + 65, y77 + 40)-(x77 + 55, y77 + 90), c0(9)
Line (x77 + 67, y77 + 42)-(x77 + 57, y77 + 90), c0(9)
Line (x77 + 55, y77 + 90)-(x77 + 57, y77 + 90), c0(9)
Line (x77 + 90, y77 + 40)-(x77 + 85, y77 + 66), c0(9)
Line (x77 + 87, y77 + 42)-(x77 + 83, y77 + 64), c0(9)
Line (x77 + 64, y77 + 66)-(x77 + 80, y77 + 90), c0(9)
Line (x77 + 62, y77 + 68)-(x77 + 77, y77 + 90), c0(9)
Line (x77 + 77, y77 + 90)-(x77 + 80, y77 + 90), c0(9)
Sleep
Cls
Locate 20, 40
Print "Land carefully on each pad. Return to the starting pad to complete."
Sleep
Do
Cls
'lower random landscape
j = 0
jj = 0
k = 170
Do
j = j + 1
jj = jj + 1
If jj > 8 Then
r = Int(Rnd * 5) - 2
jj = 0
End If
k = k + r
If k > 220 Then
k = k - r
End If
If k < 120 Then
k = k - r
End If
Line (j, scy - k)-(j, scy), c0(6)
Loop Until j >= scx
'add texture to terrain
For tt = 1 To 2
For tx = 1 To scx
For ty = 1 To scy
ttt = Int(Rnd * 18)
If ttt > 16 Then
c0(99) = Point(tx, ty)
If c0(99) <> c0(0) Then
Line (tx, ty)-(tx + 2, ty + 2), c0(12), BF
End If
End If
Next ty
Next tx
Next tt
'===== ground
Line (0, scy - 20)-(scx, scy), c0(5), BF
'===== right wall
Line (scx - 40, 0)-(scx, scy - 20), c0(5), BF
'===== left wall
Line (0, 0)-(40, scy - 20), c0(5), BF
'initialize pads
pad(1).x1 = scx / 10
pad(1).x2 = pad(1).x1 + 100
pad(1).y1 = scy - 80
pad(1).y2 = pad(1).y1 + 2
pad(1).colour = 5
pad(1).count = 0
pad(2).x1 = scx / 3 + 50
pad(2).x2 = pad(2).x1 + 75
pad(2).y1 = scy - 50
pad(2).y2 = pad(2).y1 + 2
pad(2).colour = 5
pad(2).count = 0
pad(3).x1 = scx / 2 + 50
pad(3).x2 = pad(3).x1 + 50
pad(3).y1 = scy - 90
pad(3).y2 = pad(3).y1 + 2
pad(3).colour = 5
pad(3).count = 0
pad(4).x1 = scx - 120
pad(4).x2 = pad(4).x1 + 40
pad(4).y1 = scy - 50
pad(4).y2 = pad(4).y1 + 2
pad(4).colour = 5
pad(4).count = 0
'===== pad 1
Line (pad(1).x1, yy)-(pad(1).x2, pad(1).y1), c0(0), BF
'===== pad 2
Line (pad(2).x1, yy)-(pad(2).x2, pad(2).y1), c0(0), BF
'===== pad 3
Line (pad(3).x1, yy)-(pad(3).x2, pad(3).y1), c0(0), BF
'===== pad 4
Line (pad(4).x1, yy)-(pad(4).x2, pad(4).y1), c0(0), BF
'add stars
For tt = 1 To 2
For tx = 1 To scx
For ty = 1 To scy
ttt = Int(Rnd * 1999)
If ttt > 1994 Then
c0(99) = Point(tx, ty)
If c0(99) = c0(0) Then
PSet (tx, ty), c0(14)
If ttt > 1997 Then
PSet (tx, ty), c0(1)
End If
xl = Int(Rnd * 100)
If xl > 98 Then
PSet (tx, ty), c0(15)
PSet (tx + 1, ty), c0(1)
PSet (tx, ty - 1), c0(1)
PSet (tx - 1, ty), c0(1)
PSet (tx, ty + 1), c0(1)
End If
End If
End If
Next ty
Next tx
Next tt
'===== pad 1
Line (pad(1).x1, pad(1).y1)-(pad(1).x2, pad(1).y2), c0(pad(1).colour), BF
'===== pad 2
Line (pad(2).x1, pad(2).y1)-(pad(2).x2, pad(2).y2), c0(pad(2).colour), BF
'===== pad 3
Line (pad(3).x1, pad(3).y1)-(pad(3).x2, pad(3).y2), c0(pad(3).colour), BF
'===== pad 4
Line (pad(4).x1, pad(4).y1)-(pad(4).x2, pad(4).y2), c0(pad(4).colour), BF
'===== parameters
dv = .027 ' time delay value
stx = pad(4).x1 + 20 'starting pos x
sty = pad(4).y1 - 20 'starting pos y
bnb(1).live = 1
bnb(1).colour = 3
bnb(1).x = stx
bnb(1).y = sty
j = 1
'game objective - to land safely on all 4 pads, the last one must be pad 4
'ship starts at pad 4
'======== main loop
_PutImage (1, 1)-(scx - 1, scy - 1), 0, bgsnap&, (1, 1)-(scx - 1, scy - 1)
flag = 0
Do
_Limit 30
'check for stray sounds
silence = 0
If _KeyDown(18432) Then silence = silence + 1
If _KeyDown(19200) Then silence = silence + 1
If _KeyDown(19712) Then silence = silence + 1
If silence = 0 Then 'there should be no thrust sound
If _SndPlaying(thrust&) Then _SndStop (thrust&)
End If
'update screen
keyfire1 = 0
keyfire2 = 0
keyfire3 = 0
_PutImage (0, 0)-(scx, scy), bgsnap&, 0 'replace screen with background only (no ship)
'find what's changed before drawing ship again
'what colour pixels are beneath the ship?
'need to rule out the sky somehow, so this can't interfere with the ship
skpttot = 0
c0(99) = Point(bnb(j).x - 16, bnb(j).y + 20)
red% = _Red32(c0(99))
grn% = _Green32(c0(99))
blu% = _Blue32(c0(99))
If red% = grn% And red% = blu% Then
skptl = 0
Else
skptl = 1
End If
c0(99) = Point(bnb(j).x + 16, bnb(j).y + 20)
red% = _Red32(c0(99))
grn% = _Green32(c0(99))
blu% = _Blue32(c0(99))
If red% = grn% And red% = blu% Then
skptr = 0
Else
skptr = 1
End If
skpttot = skptl + skptr
If skpttot > 0 Then
ccflag = 1 'contact
If bnb(j).yv > .5 Then ccflag = 2 ' was landing too hard?
Else
ccflag = 0 'no contact
End If
gravityadd = .025
bnb(j).yv = bnb(j).yv + gravityadd
If ccflag = 0 Then 'if ship is flying
'=============== player input
If _KeyDown(18432) Then
If Not _SndPlaying(thrust&) Then _SndLoop thrust&
bnb(j).yv = bnb(j).yv - .05
keyfire1 = 1
End If
If bnb(j).yv > 10 Then bnb(j).yv = 10
If bnb(j).yv < -10 Then bnb(j).yv = -10
If _KeyDown(19200) Then
If Not _SndPlaying(thrust&) Then _SndLoop thrust&
bnb(j).xv = bnb(j).xv - .03
keyfire2 = 1
End If
If bnb(j).xv < -5 Then bnb(j).xv = -5
If _KeyDown(19712) Then
If Not _SndPlaying(thrust&) Then _SndLoop thrust&
bnb(j).xv = bnb(j).xv + .03
keyfire3 = 1
End If
If bnb(j).xv > 5 Then bnb(j).xv = 5
'if ship is not landed anywhere
bnb(j).x = bnb(j).x + bnb(j).xv
bnb(j).y = bnb(j).y + bnb(j).yv
If bnb(j).x < 50 Then bnb(j).x = 50
If bnb(j).x > scx - 50 Then bnb(j).x = scx - 50
If bnb(j).y < 10 Then bnb(j).y = 10
If bnb(j).y > scy - 30 Then bnb(j).y = scy - 30
'ship
drawship j, c0, bnb
If keyfire1 = 1 Then
fire1 j, c0, bnb
End If
If keyfire2 = 1 Then
fire2 j, c0, bnb
End If
If keyfire3 = 1 Then
fire3 j, c0, bnb
End If
Else 'ship is touching down
'check to see if on a pad
px = bnb(j).x: py = bnb(j).y
pc = pad(1).count + pad(2).count + pad(3).count
For t = 1 To 4
If px > pad(t).x1 + 16 And px < pad(t).x2 - 16 And pad(t).count = 0 Then
If t < 4 Then
pad(t).count = 1
If ccflag = 1 Then
Line (pad(t).x1, pad(t).y1)-(pad(t).x2, pad(t).y2), c0(4), BF
eraseship j, c0, bnb
_PutImage (1, 1)-(scx - 1, scy - 1), 0, bgsnap&, (1, 1)-(scx - 1, scy - 1)
Else
Line (pad(t).x1, pad(t).y1)-(pad(t).x2, pad(t).y2), c0(2), BF
eraseship j, c0, bnb
_PutImage (1, 1)-(scx - 1, scy - 1), 0, bgsnap&, (1, 1)-(scx - 1, scy - 1)
End If
Else
If pc = 3 Then
pad(t).count = 1
If ccflag = 1 Then
Line (pad(t).x1, pad(t).y1)-(pad(t).x2, pad(t).y2), c0(4), BF
eraseship j, c0, bnb
_PutImage (1, 1)-(scx - 1, scy - 1), 0, bgsnap&, (1, 1)-(scx - 1, scy - 1)
Else
Line (pad(t).x1, pad(t).y1)-(pad(t).x2, pad(t).y2), c0(2), BF
eraseship j, c0, bnb
_PutImage (1, 1)-(scx - 1, scy - 1), 0, bgsnap&, (1, 1)-(scx - 1, scy - 1)
End If
End If
End If
End If
Next t
If pad(4).count = 1 Then
flag = 1
End If
'=============== player input
If _KeyDown(18432) Then
If Not _SndPlaying(thrust&) Then _SndLoop thrust&
bnb(j).yv = bnb(j).yv - .05
keyfire1 = 1
End If
If bnb(j).yv > 10 Then bnb(j).yv = 10
If bnb(j).yv < -10 Then bnb(j).yv = -10
'if ship is landed
bnb(j).xv = bnb(j).xv * .6 'cancel out most of existing x velocity
If bnb(j).yv > 0 Then bnb(j).yv = 0 'cancel y velocity if heading down
bnb(j).x = bnb(j).x + bnb(j).xv
bnb(j).y = bnb(j).y + bnb(j).yv
If bnb(j).x < 50 Then bnb(j).x = 50
If bnb(j).x > scx - 50 Then bnb(j).x = scx - 50
If bnb(j).y < 10 Then bnb(j).y = 10
If bnb(j).y > scy - 30 Then bnb(j).y = scy - 30
'ship
drawship j, c0, bnb
If keyfire1 = 1 Then
fire1 j, c0, bnb
End If
End If
blink = blink + 1
If blink < 25 Then
bk = 0
End If
If blink > 24 Then
bk = 9
End If
If blink > 50 Then blink = 0
If ccflag = 0 Then
Line (bnb(j).x - 1, bnb(j).y - 8)-(bnb(j).x + 1, bnb(j).y - 6), c0(bk), BF
Else
Line (bnb(j).x - 1, bnb(j).y - 8)-(bnb(j).x + 1, bnb(j).y - 6), c0(4), BF
End If
Line (45, 4)-(229, 188), c0(9), BF
_PutImage (0, 0), 0, snap&, (bnb(j).x - 30, bnb(j).y - 20)-(bnb(j).x + 30, bnb(j).y + 40)
_PutImage (47, 6)-(227, 186), snap&, 0
dy = Int(bnb(j).yv * 30)
If dy > 70 Then dy = 70
If dy < -70 Then dy = -70
dx = Int(bnb(j).xv * 30 + .49)
If dx > 70 Then dx = 70
If dx < -70 Then dx = -70
Line (222, 26)-(227, 166), c0(18), BF 'y axis
Line (222, 96)-(227, 96), c0(1), BF 'y axis centerline
Line (222, 97)-(227, 107), c0(17), BF 'y axis safe zone
Line (222, 96 + dy)-(227, 96 + dy), c0(2), BF 'y axis indicator
Line (67, 181)-(207, 186), c0(18), BF 'x axis
Line (137, 181)-(137, 186), c0(1), BF 'x axis centerline
Line (137 + dx, 181)-(137 + dx, 186), c0(2), BF 'x axis indicator
_Delay dv
_Display
Loop Until flag = 1
_Delay 4.0
Cls
Loop
End
Sub eraseship (j, c0, bnb)
Line (bnb(j).x - 16, bnb(j).y - 15)-(bnb(j).x + 16, bnb(j).y + 19), c0(0), BF
End Sub
Sub drawship (j, c0, bnb)
Line (bnb(j).x - 3, bnb(j).y - 14)-(bnb(j).x + 3, bnb(j).y - 13), c0(22), BF
Line (bnb(j).x - 5, bnb(j).y - 12)-(bnb(j).x + 5, bnb(j).y - 11), c0(21), BF
Line (bnb(j).x - 6, bnb(j).y - 10)-(bnb(j).x + 6, bnb(j).y + 4), c0(20), BF
Line (bnb(j).x - 6, bnb(j).y - 10)-(bnb(j).x - 16, bnb(j).y + 19), c0(20) 'long struts
Line (bnb(j).x + 6, bnb(j).y - 10)-(bnb(j).x + 16, bnb(j).y + 19), c0(20) 'long struts
Line (bnb(j).x - 16, bnb(j).y + 19)-(bnb(j).x - 6, bnb(j).y + 2), c0(20) 'short struts
Line (bnb(j).x + 16, bnb(j).y + 19)-(bnb(j).x + 6, bnb(j).y + 2), c0(20) 'short struts
Line (bnb(j).x - 1, bnb(j).y + 5)-(bnb(j).x + 1, bnb(j).y + 5), c0(20) 'engine
Line (bnb(j).x - 2, bnb(j).y + 6)-(bnb(j).x + 2, bnb(j).y + 6), c0(20) 'engine
Line (bnb(j).x - 3, bnb(j).y + 7)-(bnb(j).x + 3, bnb(j).y + 7), c0(20) 'engine
'highlights
Line (bnb(j).x - 6, bnb(j).y - 10)-(bnb(j).x - 6, bnb(j).y + 4), c0(20), BF
Line (bnb(j).x + 6, bnb(j).y - 10)-(bnb(j).x + 6, bnb(j).y + 4), c0(20), BF
Line (bnb(j).x - 5, bnb(j).y - 10)-(bnb(j).x - 4, bnb(j).y + 4), c0(21), BF
Line (bnb(j).x + 5, bnb(j).y - 10)-(bnb(j).x + 4, bnb(j).y + 4), c0(21), BF
Line (bnb(j).x - 3, bnb(j).y - 10)-(bnb(j).x - 2, bnb(j).y + 4), c0(22), BF
Line (bnb(j).x + 3, bnb(j).y - 10)-(bnb(j).x + 2, bnb(j).y + 4), c0(22), BF
Line (bnb(j).x + 1, bnb(j).y - 10)-(bnb(j).x - 1, bnb(j).y + 4), c0(23), BF
End Sub
Sub fire1 (j, c0, bnb)
Line (bnb(j).x - 2, bnb(j).y + 8)-(bnb(j).x + 2, bnb(j).y + 9), c0(30), BF
Line (bnb(j).x - 2, bnb(j).y + 10)-(bnb(j).x + 2, bnb(j).y + 10), c0(31), BF
Line (bnb(j).x - 2, bnb(j).y + 11)-(bnb(j).x + 2, bnb(j).y + 12), c0(32), BF
Line (bnb(j).x - 2, bnb(j).y + 13)-(bnb(j).x + 2, bnb(j).y + 15), c0(33), BF
End Sub
Sub fire2 (j, c0, bnb)
Line (bnb(j).x + 7, bnb(j).y - 5)-(bnb(j).x + 12, bnb(j).y - 4), c0(31), BF
End Sub
Sub fire3 (j, c0, bnb)
Line (bnb(j).x - 7, bnb(j).y - 5)-(bnb(j).x - 12, bnb(j).y - 4), c0(31), BF
End Sub