简体   繁体   中英

Collision of a line and object ( Corona SDK )

I am developing a game when there is a line and physics object

The line code is:

And the interesting thing is that when i code print ("collision is here") (for ex) they some how don't even collide!

Both line and obj bodies are static

How can make this collision happed? thanks in advance!

静态物体不能互相碰撞,但是这个问题有一个解决方案。

如果两条线都是静态的,则创建一个函数,您可以在其中检测两个对象的x和y并相应地建立方程式,例如:line.x + 20> obj.x然后print(collide)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM