Requirements:
1.Automatically bounce back when it reaches the edge.
2.Only the X coordinate changes, while the Y coordinate remains unchanged.
Currently, the movement only happens when I press a key on the keyboard. However, I want the movement to occur automatically. Can someone provide suggestions? Thank you very much!