花栗鼠的身体随着视差移动?

发布于 2024-09-10 13:00:03 字数 211 浏览 3 评论 0原文

我正在使用 Cocos2D、SpaceManager 和 Chipmunk。我有一个有 4 层的视差节点,它与可玩花栗鼠身体的位置相关。该物体需要与视差层之一上的静态物体发生碰撞,静态物体必须从屏幕开始,然后移入屏幕并发生碰撞。

我知道你不应该用花栗鼠来移动静态物体,除非你重新进行。然而,每秒重新哈希 60 次以跟上帧速率似乎很混乱。谁能想到另一种方法来做到这一点?

干杯。

I'm using Cocos2D, SpaceManager and Chipmunk. I have a parallax node with 4 layers on it, this is tied to the location of a playable chipmunk body. This body needs to collide with static objects on one of the parallax layers, the static bodies must start off screen then move into screen and collide.

I know you are not supposed to move static bodies with Chipmunk, unless you rehash. However, rehashing 60 time a second to keep up with the framerate seems messy. Can anyone think of an alternate way to do this?

Cheers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

澜川若宁 2024-09-17 13:00:03

您可以尝试的一件事是使用刚性关节将每个视差层中的所有对象连接到非碰撞体。然后沿着视差层移动该主体以拖动对象。但这可能不是最好的方法。

One thing you could try is joining all the objects in each parallax layer to a non-colliding body using rigid joints. Then move that body along with the parallax layer to drag the objects along. THis may not be the best method, though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文