Advertisement

How to done collision detection in tile base game?

Started by January 18, 2001 09:07 PM
1 comment, last by Benjamin 24 years ago
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.
Gee Brain, what we gonna do tonight?
Advertisement
Thanks
Actually, I am using an array with size*4 for each tile. Since there is no way for object overlap others, so I think 4 object should be the max size in a same array. I''ll change it to list now, it seems more flexible.
Ben

This topic is closed to new replies.

Advertisement