→Collision Detection Against Walls
=== Collision Detection Against Walls ===
Collision detection with the map structure is simplified by the use of simple int array that holds the tile type data. Considering the fact that the total number of Box objects created easily exceeds 1000 (when loading a 20 by 20 map), we thought it will be more efficient to compare the integer tile type codes than actually comparing floating point coordinates. To add more efficiency, as described in the image above, update() module selectively retrieves only the necessary tile data from the tile array and determines whether the character can proceed or not.