How to done collision detection in tile base game?
hello
when in tile base game, I check the movement of the player and which tile(s) he belong to and then check is there another object in the same tile, then do the collision detection.
So i want to know if it is an efficient way to do so.
Ben
That kinda depends on how you are doing it.
You also need to check the surrounding tiles because an object could overlap between several tiles.
How do you know what objects are in the tile? Are you checking all the objects for a number, or does each tile contain a linked list of objects it contains? If the latter, then you would be better off with sectors (size of multiple tiles) than single tiles, depending of course on how big your tiles are.
You also need to check the surrounding tiles because an object could overlap between several tiles.
How do you know what objects are in the tile? Are you checking all the objects for a number, or does each tile contain a linked list of objects it contains? If the latter, then you would be better off with sectors (size of multiple tiles) than single tiles, depending of course on how big your tiles are.
Gee Brain, what we gonna do tonight?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement