Hi
Here is my situation. I have the following code.....
`setuo
sync on
sync rate 0
hide mouse
`dims
dim active(100,2)
maxwait=150
`make gun
make object cylinder 111,1
scale object 111,100,200,100
color object 111,rgb(0,0,255)
xrotate object 111,90
fix object pivot 111
` make enemy
make object cube 200,5
position object 200,0,0,30
make object collision box 200,5,5,5,5,5,5,1
`make bullets
for b=1 to 100
make object sphere b,1
color object b,rgb(255,0,0)
hide object b
next b
`main loop
do
set object collision on 200
set global collision on
`backdrop
color backdrop 0
`controls
if rightkey()=1 then yrotate object 111,wrapvalue(object angle y(111)+1)
if leftkey()=1 then yrotate object 111,wrapvalue(object angle y(111)-1)
`pos cam
position camera object position x(111), object position y(111)+5, object position z(111)-5
gosub shoot
`end
sync
loop
shoot:
`for
for b=1 to 100
`shoot
if spacekey()=1 and active(b,1)=0 and (timer()-lasttime)>maxwait
position object b, object position x(111), object position y(111), object position z(111)
set object to object orientation b,111
active(b,1)=1
active(b,2)=200
show object b
lasttime=timer()
endif
`move bullet
if active(b,1)=1
move object b,5
active(b,2)=active(b,2)-1
endif
`stop when bullet run out
if active(b,2)<0
active(b,1)=0
active(b,2)=0
hide object b
endif
next b
return
I want it so that when my bullets hit the box it prints "hit" at the top of the screen. But I cant get the collision to work. Any suggestions?
P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.