game1:
`player
load object "body.3ds", 989
Make object 1,989, 0
`scale object 1, 1,1,1
Make Camera 1
Color Backdrop 1,RGB(0,0,255)
`art
`seed enemy spawns
randomize timer()
`board
Make object Box 100,50,1,600: Position object 100,25,-1,250: Color Object 100,RGB(200,200,0)
sp1=50
sp2=150
sp3=250
sp4=350
sp5=450
sp6=550
yp1=48
yp2=48
yp3=0
yp4=48
yp5=0
yp6=0
make object sphere 26, 2: color object 26, RGB(0,0,0): position object 26, yp1,2,sp1 : set object collision on 26
make object sphere 27, 2: color object 27, RGB(0,0,0): position object 27, yp2,2,sp2 : set object collision on 27
make object sphere 28, 2: color object 28, RGB(0,0,0): position object 28, yp3,2,sp3 : set object collision on 28
make object sphere 29, 2: color object 29, RGB(0,0,0): position object 29, yp4,2,sp4 : set object collision on 29
make object sphere 30, 2: color object 30, RGB(0,0,0): position object 30, yp5,2,sp5 : set object collision on 30
make object sphere 31, 2: color object 31, RGB(0,0,0): position object 31, yp6,2,sp6 : set object collision on 31
once_only = 1
obj1=0
obj2=0
obj3=0
obj4=0
obj5=0
obj6=0
`loop
Do: Hide Mouse
Sync Rate 25
`controls
zcounter=0
if zpos# < 600 then zpos#=zpos#+1
if z# < 600 then z#=z#+1
if rightkey() then xpos#= 1.5
if leftkey() then xpos#= -1.5
if rightkey()=0 and leftkey()=0 then xpos#=0
if rightkey()=1 and spacekey()=1 then zcounter=1 :gosub attack_sub
if leftkey()=1 and spacekey()=1 then zcounter=2 : gosub attack_sub
if spacekey()=1 then zcounter=3 : gosub attack_sub
if spacekey()=0 then zcounter=0
if zpos#=80 then obj1=1
if zpos#=180 then obj2=1
if zpos#=280 then obj3=1
if zpos#=380 then obj4=1
if zpos#=480 then obj5=1
if zpos#=580 then obj6=1
`spawn control
if obj1=1 then yp1=yp1-1 : position object 26, yp1, 2, sp1
if obj2=1 then yp2=yp2-1 : position object 27, yp2, 2, sp2
if obj3=1 then yp3=yp3+1 : position object 28, yp3, 2, sp3
if obj4=1 then yp4=yp4-1 : position object 29, yp4, 2, sp4
if obj5=1 then yp5=yp5+1 : position object 30, yp5, 2, sp5
if obj6=1 then yp6=yp6+1 : position object 31, yp6, 2, sp6
`death conditions
`positions and variables
Position Object 1,25+xpos#,1,zpos#-60
`camera
Point camera 1,25,-2,z#+10: Position Camera 1,25,14,z#-80
rz#=rz#-4
if zpos#>599 then set text size 40:SET CURSOR 0,40:print "end":set cursor 0,290:set text size 30:print "(press escape)"
loop
attack_sub:
make object box 46, 20,5,50
set object collision on 46
position object 46, 25, 4, zpos#
if zcounter=3 then position object 46, 25, 2, zpos#
if zcounter=2 then position object 46, 10, 2, zpos#
if zcounter=1 then position object 46, 40, 2, zpos#
for x=26 to 31 step 1
if object collision(x, 46)>0 then hide object x : if x = 26 then obj1=0 : if x = 27 then obj2=0 : if x = 28 then obj3=0 : if x = 29 then obj4=0 : if x = 30 then obj5=0 : if x = 31 then obj6=0
next x
delete object 46
return
Ok, done.