Should I be checking all possible tiles for tile-based collision?

Started by
0 comments, last by Morpheus011 17 years, 11 months ago
My current implementation for tile-based collision tests against all tiles that an object overlaps between its position last frame and the current frame(of course breaking from the loop once it finds a tile it collided with). Is this the best way to go about it? Also, what's considered the "best" way to do broad collision detection between objects? I've thought about seperating the world into sub-tiles of decreasing size, and checking against these tiles until it either reaches a tile that they're not both overlapping, or perform narrow collision detection when they're both on the "smallest" tile.
Advertisement
I think you may want to look into spatial partitioning systems. If you're using tiles, Then you probably don't have to worry about all 3 dimensions when checking collisions. If this is the case, look into implementing quad-trees. This greatly simplifies the amount of work necessary to perform collision checks of this sort.

This topic is closed to new replies.

Advertisement