Coronasdk:如何检查物体是否处于碰撞状态?
由于我仍然不购买 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
三天过去了,还没人回复……
我找到了一些解决方案,但可能不是最好的解决方案。
无论如何,希望这对其他人有用。
我的解决方案是进行旧的传统碰撞检查(没有物理),例如球体碰撞或盒子碰撞。
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.