andreww
02-28-2002, 08:42 AM
i am making a game with 16 tanks, which fire one shot then reload for a few seconds , mean while the shot it has fired will expire before the tank reaches fire time again
i am doing this to make the arrays faster, so what im doing is
detecting if any of the 15 shots(not including own shot)
hits each tank, ie.
For s = 1 to 15
For t = 1 to 16
if Bullet(s)= TankPosition(t) then DamageTank
next t
next s
in my collision detection i am basically checking if the bullet moves inside of 4 points ie
. .
. .
i was wondering if there is a better/faster way of detecting whether the bullets have hit any of the 16 tanks
remember there will be heaps of other code, so this collision detection that i will be using wont be the only code there.
i am doing this to make the arrays faster, so what im doing is
detecting if any of the 15 shots(not including own shot)
hits each tank, ie.
For s = 1 to 15
For t = 1 to 16
if Bullet(s)= TankPosition(t) then DamageTank
next t
next s
in my collision detection i am basically checking if the bullet moves inside of 4 points ie
. .
. .
i was wondering if there is a better/faster way of detecting whether the bullets have hit any of the 16 tanks
remember there will be heaps of other code, so this collision detection that i will be using wont be the only code there.