+ 2
How do we make animations move back and forth
3 Réponses
+ 9
Thanks to YouTube 👇 watch this
https://m.youtube.com/watch?v=CZAXucMryxU
🎥 JavaScript Animation Tutorial - Animating a UI with the ...
+ 4
If you want to move a rectangle back and forth, then you can have a variable representing the current x-axis position of the rectangle and have another variable representing how much to increase the x-axis of the rectangle. If the rectangle is at the edge of the screen to the right, then the variable that represents how much to increase the x-axis position becomes its value in negative form. And if the rectangle is at the edge of the screen to the left, then the variable representing how much to increase the x-axis of the rectangle becomes positive.
https://code.sololearn.com/WxB5T8Zbr3YT/?ref=app
+ 2
Thanks