- Player ship collides with asteroid
- Enemy ship collides with asteroid
- Player bullet collides with asteroid
- Enemy bullet collides with asteroid
However, I am now getting a weird issue where the asteroid sometimes splits correctly, and other times does not split at all. I'm not sure if this is a function problem or a rendering problem, because I am also having weird issues where 'invisible asteroids' collide with my ship despite the fact that they never rendered on the screen.
Here is the function in question:
Can anyone help me out? I'm confused as to why this is happening after I moved my code to a function call. Is it possible for the function to be called multiple times? Say both the player bullet and the enemy bullet hits an asteroid. Previously, the code that is now in the function would have been duplicated as an event chain for the player bullet -> asteroid collision and the enemy bullet -> asteroid collision, but now both collisions will call the same function.