Collision of a line and object ( Corona SDK )

2019-09-04 11:54发布

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!

2条回答
仙女界的扛把子
2楼-- · 2019-09-04 12:15

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

查看更多
Summer. ? 凉城
3楼-- · 2019-09-04 12:23

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).

查看更多
登录 后发表回答