Hi all, I have been trying for the past couple days to get the collisions in my game to work properly. Currently, they only work sometimes, and only for the bullets.
Like sometimes, when bullets hit enemies, the score goes up, and the bullet and enemy objects both destroy, as they should. But other times, the bullets just go right past the enemy, but actually rotate the enemy a little bit, meaning that they do seem to be hitting, it’s just none of the code is executing.
My guess is that I need some sort of collider on my objects, but I’m not quite sure how to go about doing that. I’ve tried a couple things like Box2D, but I couldn’t get it to work. I was hoping someone here could point me in the right direction. I’ve attached my code.