My opponent (the hand) doesn’t move back and forth; I’ve tried to replicate the opponent from the game Platformer, but as I said, it doesn’t work, and I would be grateful if you could explain to me how it could work.
Which object is your opponent? I opened your game but only saw the main character, the red triangle and the biscuit.
So the cookie is the game character, and there should actually be a hand, which is the opponent: Candli Play
The main issue in the hand code is that you are using absolute speeds, while relative speeds would allow for simple back-and-force movement.
But you find a work-around which is actually quite nice!