I am trying to make a 3d-asteroids game the only major problem I have is how to get object collision to work.
I have used a sphere to get camera collision with my walls/asteroids with the folowing code:
For x = 1 to 6 (the walls)
if object collision (x,7) > 0
code to get camera back to where it is supposed to be
endif
next x
For x = 10 to 16 (the asteroids)
if object collision (x,7) > 0
code to get camera back to where it is supposed to be
endif
next x
and this by itself works fine. The problem comes when I try to get a bullet to hit an asteroid. I have used the following
For x = 10 to 16 (the asteroids)
If object collision (x,9) > 0 (have also tryed 9,x)
do stuff
Endif
Next x
What happens now is that neither the bullet nor the camera object will hit the asteroids unless BOTH of them are hitting at once in which case only the bullet part of the code will work.
Can anyone help me pls