Cocos2d / Box2d CCRibbon 碰撞检测
我正在 iOS 上开发一款游戏,使用 cocos2d+box2d 作为游戏引擎,并尝试添加一个 CCRibbon (其中的点用触摸填充),我知道如何做到这一点,并将 CCRibbon 的形状链接到box2d,因此当物体与它碰撞时(由于重力),它会像正常物体一样反弹。有人知道如何做到这一点/给我替代方案吗? 非常感谢, 亚历山大·卡萨涅
I'm developing a game on iOS w/ cocos2d+box2d as the game engine, and am trying to add a CCRibbon (wherein the points get populated with touches), that I know how to, and to get that CCRibbon's shape linked up to box2d, so when an object collides with it (due to gravity), it bounces off as if it were a normal thing. Would anyone happen to know how to do this / give me alternatives ?
Many thanks,
Alexandre Cassagne
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
获取每个点并使用这些点+调整来创建一个薄的静态矩形 box2d 多边形,以使其成为一个形状。
当然,不要完全复制该代码,它只是我所记得的,而且我也确信它是 C# 和 Actionscript 3 的组合。它是一个不那么伪的代码,有很多你需要填写的空白。为什么评论在那里:P。
基本上我就是这么做的。不过我的经验只是在box2d for flash 中。
Take each point and create a thin static rectangular box2d polygon using the points + the adjustment to make it a shape.
of course don't copy that code exactly its just from what i remember and i'm also sure its a combination of C# and Actionscript 3. its kindof a not so pseudo code with lots of blanks you'll need to fill in. Why the comments are there :P.
Thats basically how i would do it though. My experience is only in box2d for flash though.
你读过这篇文章吗...http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone
Have you read this....http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone