Tag Info

Hot answers tagged


You're talking about broad-phase collision detection—a system that lets you return early when clearly no collision is happening. I've previously written this overview of collision optimisation. Such systems typically use a spatial indexing scheme. Popular choices in games include grid-based spatial hashing, quadtrees and k-d-trees. All make different ...


Here's a small pseudocode example of something kinda similar to the system I'm using for my game. Basically the important trick here is to check both the topleft of your player, and the bottomright of your player, which is enough as your player is rectangular and of the fitting size. If the player character would be bigger than two tiles, you would have to ...

Only top voted, non community-wiki answers of a minimum length are eligible