I have a function to check collisions between the player and the tiles, im creating stages with tiles, if the stage its too large then im only checking collision with those tilles are inside the view ( to not to check the whole bunch of tiles along the stage ), but I was reading about quadthrees collision, but instead to divide that view in 4 internal rectagles what if I create a rectangle area that its surrounding the player, then check only the collision that are inside that rectangle meaning that those tiles are about to collide with player?
Ultimately, youll be better served by just figuring out something that works without concerning yourself with performance until it becomes necessary.
The answer to your question will depend on whether or not the entity movement is grid based or not.
What I’ve done in the past was to have the velocity determine where the next frame would land and then determine if any collisions occured between the two points. Also, checking that anything outside the screen could not be part of the collision…