Atan2 and aiming info.

Blitz3D Forums/Blitz3D Beginners Area/Atan2 and aiming info.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yeah, if you're checking for collisions between all objects against all other objects then things can get slow fairly quickly. There are ways to get round the problem, though.

I've used a method in the past called 'shifted grid' collision checking which basically divides the playing area into a grid. You then only check for collisions between objects that occupy the same grid cell. To catch collisions between objects on a grid boundary, you also have to 'shift' the grid up, down, left and right, re-checking for collisions each time. Sounds a bit complicated but it worked very well for me. ;)

Have a look at some game dev websites - there are probably several other solutions, too.