I have a tile map of 64 x 64 pixel tiles (10 rows, 10 columns) I want to detect collision between the moving units and any walls or objects. How can i keep the units centered in the tile map while moving then detect if a unit should change direction without updating his position to soon, and throwing him off the center of the tile?
Example: If there is an object at TilePositionX = 3, and TilePosition = 0 and that object makes a unit change his direction but always stay centered. If the unit is heading right towards the object at a XVelocity = 1.0f (this could be any velocity) every update. Do i have to detect the center position of the unit then add an offset and check if I'm completely inside a tile? I can't of a good solution for my problem.