Setting up collision using a tilemap and cocos2d

Posted by James on Game Development See other posts from Game Development or by James
Published on 2011-09-03T12:15:09Z Indexed on 2012/09/21 3:51 UTC
Read the original article Hit count: 354

I'm building my first platformer using cocos2d and a tilemap. I'm having trouble coming up with a decent way of determining if the character is colliding with an object. More specifically, in which direction is the character colliding with an object.

Following the tutorial here, I have made a separate "meta" layer of collidable tiles. The problem is that unless the character is in the tile, you can't detect the collision. Also, there's no way of telling WHERE the collision is occurring.

The best solution would be one that could tell me if a character is up against a wall, or walking on top of a platform. However, I can't seem to figure out a good technique for this.

© Game Development or respective owner

Related posts about collision-detection

Related posts about cocos2d-iphone