Perhaps you could view your bullets at quantum bullets. Sometimes they're there, sometimes not. Make a feature out of the 'bug'.
Just kidding of course. Don't know if this is helpful but when I make simple games involving collision detection I make my moving objects round and use the Pythagoras to calculate distance between objects' centers and then compare to sum of radius. Works must of the time unless when I mess up code.
Good luck.
Last edited by Jonax; 31-08-2019 at 10:40 AM. Reason: grammar
in which order do you check the collision? does the asteroid check first or the bullet? I suggest you put your collision detection on the fastest object. also, if the bullet is inside the polygon take it as a collision, even if it didn't hit any lines in between movement positions. that should resolve your troubles.
EDIT: another thing to have in mind. bullets and asteroids don't dodge each other, they follow straight paths. so, if from one frame to the next, the bullet position cross the path of an asteroid, it's a hit too even if they didn't hit due to small sized asteroid.
Last edited by pitfiend; 21-08-2019 at 08:02 PM.
Bookmarks