collision detection for non-rectangular, sparky images in Xcode
I'm making a maze-solving iphone app, and I was wondering if it is possible to make irregular-shaped images such as sparky ones, or the ones that are empty inside, etc. Could it be done by controlling the alpha value? And i开发者_运维技巧f possible, how do we implement collision detection for such irregular images? (I'm sure it's possible and I'm guessing it could be done by referring to alpha value of the pixel, but I just want to be concrete...)
Also, for rectangular images so far, I have built my own basic collision detection function, which basically checks for axes values among all objects every frame, which I'm guessing could be a waste of computation and memory. Does using chipmunk for collision detection make it more waste-free or efficient?
Please help me out! and Thanx in advance.
Yes. Box2d and Chipmunk will allow you to set the shape of the sprite (circle, square, rect, etc) and define it and it will monitor for collisions.
Here is a great site for basic Cocos2d tutorials using Chipmunk and Box2d
精彩评论