I have a ball (32x32 px) bouncing off walls. Sometimes the ball will shoot through the wall eventhough the walls and ball are solids. Is this a bug or do I have a setting not right?
How you implement it? With physics? Or you wrote own collision routine? The walls are solids?
Develop games in your browser. Powerful, performant & highly capable.
Also depends on speed of ball and width of collision object, as it is possible that in one tick, if the ball is traveling too fast, it can pass through an object due to it moving too many pixels in that 1 tick.
Need more info.
zenox98 got it right! And if trying to play on a slower device then risk is higher....
You have to add condition that will trigger when the ball leave the layout and return it back into layout at the position where it left. Of course before the border.
I think it has to do with speed. The ball's bullet speed was 500 and I guess since the walls are also 32x32 the ball will shoot right through. I lowered the ball's bullet speed to 350 and it seems to be reacting alright. Thanks all