Collision of a line and object ( Corona SDK )

ぃ、小莉子 提交于 2019-12-25 05:24:27

问题


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!


回答1:


Static bodies can't collide with each other, but this question has a solution.




回答2:


IF both lines are static make a function where you detect the x and y of both object and make equation accordingly, for example : line.x + 20 > obj.x then print(collide).



来源:https://stackoverflow.com/questions/11915215/collision-of-a-line-and-object-corona-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!