Physics object passing through wall object in corona sdk

百般思念 提交于 2019-12-24 00:55:07

问题


I am hitting a ball with a force and there is a wall which is assigned a physics property and is static, but the ball is dynamic, the problem is when enough force is applied to the ball it passes through the wall, it is a type of table wall as in sample simple pool game. I have used ball.isBullet=true but same problem is there. Please suggest how to solve it.. thanks


回答1:


This is a fairly common issue when dealing with small, fast-moving objects. Typically, the best solution is to make the "walls" thicker, if that is possible within your game. Also, you may increase the velocity and position iterations (links below)... just remember that both of these (along with .isBullet=true) may result in a slight performance penalty, so the first approach is the best.

http://docs.coronalabs.com/api/library/physics/setVelocityIterations.html http://docs.coronalabs.com/api/library/physics/setPositionIterations.html

Brent Sorrentino



来源:https://stackoverflow.com/questions/19229076/physics-object-passing-through-wall-object-in-corona-sdk

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