I have a sprite and i want it to rock back and forth while staying in the same place forever. How?
It's hard to understand without more details. Perhaps you can actually do it with animation.
Develop games in your browser. Powerful, performant & highly capable.
You mean like this