So I made the platform that the ball bounces off, follow the mouse. But it goes through the wall when I move it all the way to the left or right. How can I make the platform stop when it hits the solid wall?
Fyi: the platform is a solid too.
Develop games in your browser. Powerful, performant & highly capable.
if you are using an event like:
Every tick: set platform.X to mouse.X
do instead:
Every tick: set platform.X to clamp(mouse.X, lowestX, highestX), where lowestX is the lowest value of the X position of the platform you want, and highestX the highest