Could somebody tell me why my collision is not working with this?
hide mouse
TEXT 260,0,"Mission Briefing 1"
SET CURSOR 0,50
PRINT "Deep in space a sudden asteroid storm has started."
PRINT "Unlucky for you, you happened to be in the middle of it when it started."
PRINT " "
PRINT "And you can't go home."
PRINT " "
PRINT "For the asteroids are threataning to smash into earth - a blast that would devestate the planet."
PRINT "Also unlucky, your ship has no weapons."
PRINT " "
PRINT "However it is capable of extremely high speeds which can destroy these asteroids."
PRINT "Unfortunately, it also uses up a lot of gas when you run at high speeds."
PRINT "Also, be careful. Hitting those asteroids at low speeds can do some serious damge to your hull!"
PRINT " "
PRINT "Remember, your earth's only hope."
suspend for key
speed = 10
load image "space station.psd",2
autocam off
gas# = 1000
hull = 100
sync on
load image "rain.bmp",1
load image "pink.bmp",3
shot = 0
load object "AIRPL095.X",10
yrotate object 10,180
scale object 10,200,200,200
fix object pivot 10
make object sphere 1,-50000
set camera range 1,100000
texture object 1,2
position object 1,0,0,0
for d = 11 to 70
make object sphere d,100
g = rnd(10000)
j = rnd(10000)
if g > 5000 then g = g - (g*2)
if h > 5000 then h = h - (h*2)
position object d,g,rnd(100),j
texture object d,1
next d
texture object 15,3
set global collision on
position object 10,240,10,250
position camera 250,25,250
anum = 189
set global collision on
do
if spacekey()=1 then speed = 100 ; gas# = gas# - .1
aY# = Object angle Y(10)
aX# = Object angle X(10)
`texture object 10,1
Rem Control input for camera
move object 10,speed
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-1) ; Yrotate object 10,Wrapvalue(aY#-1)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+1) ; Yrotate object 10,Wrapvalue(aY#+1)
if downkey()=1 then Xrotate object 10,Wrapvalue(aX#+.5)
if upkey()=1 then Xrotate object 10,Wrapvalue(aX#-.5)
Rem get player object position and store in X# and Z#
X# = Object position x(10)
Z# = Object position z(10)
y# = object position y(10)
if y# > 100 then y# = 100
if y# < 5 then y# = 5
for g = 11 to 70
if object collision(10,g) = 1 and speed > 10 then delete object g
next g
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
position object 10,x#,y#,z#
Rem position camera
Position Camera cX#,50,cZ#
text 10,10,"Asteroids Remaining: " + str$(anum)
text 10,30,"Gas Remaining: " + str$(gas#)
text 10,50,"Hull Remaining: " + str$(hull)
Rem point the camera at the player object
Point camera X#,50,Z#
Rem Refresh Screen
anum = 0
for k = 11 to 200
if object exist(k) = 1 then anum = anum + 1
next k
speed = 10
Sync
gas# = gas# - .01
loop
Note: you may have to remove the teture commands.
JetRace coming. Watch out!