如何在 cocos2d 中测试精灵碰撞?精灵、测试、如何在、cocos2d

由网友(踩你坟头跳鬼舞i)分享简介:如何开始实现精灵碰撞类?How do I start to implement a class for sprite collision?推荐答案正如 Eric 指出的,CGRectIntersectsRect 是测试两个边界矩形是否重叠的方法.使用 CCNode 类的 boundingBox 方法为每个精灵(或...

如何开始实现精灵碰撞类?

How do I start to implement a class for sprite collision?

推荐答案

正如 Eric 指出的,CGRectIntersectsRect 是测试两个边界矩形是否重叠的方法.使用 CCNode 类的 boundingBox 方法为每个精灵(或其他节点)获取正确的边界框.

As Eric pointed out, CGRectIntersectsRect is the method to test two bounding rects for overlapping. Use the boundingBox method of the CCNode classes to get the correct bounding box for each sprite (or other node).

在这里查看我的答案:Cocos2d 游戏中的碰撞检测?

阅读全文

相关推荐

最新文章