Coronasdk:如何检查物体是否处于碰撞状态?

发布于 2024-12-02 04:41:26 字数 334 浏览 1 评论 0原文

由于我仍然不购买 Corona,所以我仍然无法使用他们的论坛。 希望这里有人能给我答案。

我遇到了关于碰撞的问题。 由于碰撞 Api 的事件阶段只有“开始”和“结束” 当碰撞处于“开始”状态时,我将对象的移动标志设置为 false 并在碰撞处于“结束”状态时设置 flag = true。

然而,在碰撞事件中,当碰撞的对手突然消失时(进入“开始”状态后), 该对象将保持在“开始”状态。即使没有任何东西与物体发生碰撞, 状态仍处于“begin”。我想知道为什么状态没有更改为“结束”

我已经检查了对象 api,但没有诸如“isCollision”之类的属性...

我不知道该对象发生了什么。

Since I still do not buy corona, I still cannot use their forum.
Hope someone here may have the answer for me.

I got the problem about collision.
Since collision Api's event phase has only "began" and "ended"
I set the object's move flag = false when collision is in "began" state
and set flag = true when collision is in "ended" state.

However, during collision event, when the collision' opponent was suddenly disappeared(after enter to "began" state),
The object will stay in "began" state. Even though, there is nothing collide to the object,
the state is still in "began". I wonder why the state is not change to "ended"

I have checked on object api but there is no property such as "isCollision"...

I do not know what is going on with the object.

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

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

发布评论

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

评论(1

夜光 2024-12-09 04:41:26

三天过去了,还没人回复……
我找到了一些解决方案,但可能不是最好的解决方案。
无论如何,希望这对其他人有用。

我的解决方案是进行旧的传统碰撞检查(没有物理),例如球体碰撞或盒子碰撞。

Since 3 days has passed and no one replied....
I found some solution about this but may be not a best solution.
Anyway, hope this will be useful for another people.

My solution is making the old traditional collision check(without physic) such as sphere collision or box collision.

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