Original Post
I've started writing a basic engine for a space invaders-style shoot em up and am having difficulty determining what the best way will be to handle collision detection. The goal is to create a bullet hell shmup that initially will only support the following collisions: - Player vs enemy - Player vs enemy bullet - Enemy vs player bullet My objects contain x and y coordinates as well as x and y velocities that measure the number of pixels traveled per frame (as described in Lazy_foo's SDL tutorials). However, I'm worried about cases where a high velocity object might "jump" over another object in one frame. In other words, if the player's hitbox is 10x10, and there is a 1x1 bullet with a velocity of 12, it is conceivable that the bullet will skip over the player entirely in one frame. Generally speaking, what are some best practices here? Am I approaching this from the right angle? It seems like having xVel and yVel makes move functions very easy to program, but creates constraints to how big your velocities can be (or how small your objects can be). If this is a valid concern, what are some simple alternatives? Thanks!