How do I set mouse position or touch position moving object only left and right ? I need make pong game,but I need to move object only at position left and right.
Every tick : set Paddle position to Touch.X and Paddle.Y
Develop games in your browser. Powerful, performant & highly capable.
or
every tick : paddle - set X to touch.x
( no need to set y each time)