Here is the code for the second level of my game...
`Level 2
level2:
cls
timeleft(0)=timeleft(0)-1
set cursor 0,0
print "Player ",player(0)," Has ",timeleft(0)," Time Left "
`Barriers
for b=300 to 302
make object box b,30,10,10
set object collision on b
position object b, 100+rnd(100), 0, 90+rnd(100)
next b
`landmines
For m=303 to 310
make object cube m, 3
color object m, RGB(0,255,0)
set object collision to boxes m
position object m, 100+rnd(50), 0, -100+rnd(100)
next m
`big blue killy thingys
for t=311 to 315
make object cube t, 10
color object t, RGB(0,0,255)
set object collision to boxes t
position object t, 100+rnd(50), 0, 100+rnd(50)
next t
`nest A
a=316
make object box a, 30, 10,10
color object a, RGB(90, 50,50)
position object a, 100+rnd(50), 0, 50+rnd(50)
`target A
b=317
make object box b, 30, 10,10
color object b, RGB(50,50,50)
position object b, 100+rnd(50), 0, 50+rnd(100)
set object collision to boxes b
`nest b
c=318
make object box c, 30,10,10
color object c, RGB(90, 50, 50)
position object c, 100+rnd(50),0, 90+rnd(50)
`target b
d=319
make object box d, 30,10,10
color object d, RGB(50,50,50)
Position object d, 150+rnd(50),0,100+rnd(50)
set object collision to boxes d
`make bullets A
for b=2000 to 2002
make object sphere b, 2
next b
`position the bullet in nest A
for b=2000 to 2002
position object b, object position x(a), object position y(a), object position z(a)
next b
`make bullets for nest c
for b=2003 to 2005
make object sphere b, 2
next b
for b=2003 to 2005
position object b, object position x(c), object position y(c), object position z(c)
next b
`make flag
f=320
make object box f,5, 50, 5
color object f, RGB(50,0,10)
set object collision to boxes f
position object f, 100, 0, 100
`make enemies
for e=321 to 340
make object cube e, 3
color object e, RGB(255,0,0)
position object e, 200+rnd(50),0,90+rnd(100)
set object collision to boxes e
next e
`make enemies 2
for e=341 to 350
make object cube e, 3
color object e, RGB(255,0,0)
position object e, 100+rnd(50),0,-100+rnd(100)
set object collision to boxes e
next e
`make enemies 3
for e=351 to 360
make object cube e,3
color object e, RGB(255,0,0)
position object e, -100+rnd(50),0,100+rnd(100)
set object collision to boxes e
next e
do
`Time countdown
if timeleft(0)>0
gosub selection
endif
`timer!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
timeleft(0)=timeleft(0)-1
set cursor 0,0
print "Player ",player(0)," Has ",timeleft(0)," Time Left "
if timeleft(0)<0
timeleft(0)=0
endif
if timeleft(0)<0
gosub wave2a
endif
`Fires the bullet from the gun, towards the target.
fire=1
for b=2000 to 2002
t = 317
if fire=1
point object b,object position x(t),object position y(t),object position z(t)
move object b, 10
endif
rem if object collision(b,t)>0
if object collision(b,0) = t
fire=0
position object b,object position x(a),object position y(a),object position z(a)
endif
next b
`Fires the bullet from the gun, towards the target.
fire=1
for b=2003 to 2005
t = 319
if fire=1
point object b,object position x(t),object position y(t),object position z(t)
move object b, 10
endif
rem if object collision(b,t)>0
if object collision(b,0) = t
fire=0
position object b,object position x(c),object position y(c),object position z(c)
endif
next b
`turn barriers left and right
for b=300 to 302
if rightkey()=1
turn object right b , 1
endif
next b
for b=300 to 302
if leftkey()=1
turn object left b, 1
endif
next b
sync
loop
return
wave2a:
for e=321 to 360
move object e,.1
next e
return
as you can see, at the end of the code is a subroutine that moves objects 321 to 360, I have it so that this subroutine is called when the variable "timeleft(0)" is below zero, and thus the objects should start to move. however, they do not. Please look at this code and see if you can spot the error.
Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.