|
-
M.D.
really all you need is an efficient loop, maybe a simple cell data structure. Will you know the max speed of any projectile?
if so you can create cells the size of this maxspeed and add/remove objects from the cell, so you only need to loop over objects in the current bullets cell. Very simple and efficient.
I think computing collisions at the spawn time of a bullet is going to be much more CPU intensive than a loop. Especially if objects are going to move, you'd have to loop over every single object, find its future position compared with the bullets future position and see if an intersection happens. You also would have to keep the loop running until all objects have been checked otherwise you'll get inaccuracy problems. Sounds bad to me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|