Hitbox detection?

The world is a 2-D array. Just compute the left, right, top, and bottom array indexes that the player overlaps and only check the rectangle of cells in the grid that the player could possibly touch.

3 Likes