how do I make a sprite go back and forth? I want it to go to the rock and back to the base. Is this possible?
Develop games in your browser. Powerful, performant & highly capable.
There are a few ways to do this. You can use the sine behavior for simple back and forth motions.
Or you can try tween x/y from base to rock. On finished, trigger another tween that goes the other way and repeat.
using pathfinding
Same idea. Use the pathfinding "On Arrived" trigger to start the next leg/return trip. You can use an instance variable to keep track of which direction you are going, or rather where you need to go next.