Time for action – setting the cat in motion, forever
So far, the cat has moved incrementally across the screen each time we clicked the green flag. Now, we're going to introduce the idea that the cat can stay in motion forever.
We want to wrap the stack of blocks in a forever block. To do this, click on the move (10) steps block in the script and detach it from the when flag clicked.
Now, from the Control palette, snap the forever block onto the when flag clicked block. Grab the stack of blocks you detached and drag it to the center of the forever block. Your script should look like the following screenshot:
Run the script and watch the cat disappear from the stage.
Let's get the runaway cat back. From the Motion palette, add the if on edge, bounce block to the bottom of the forever block. Now, watch the cat reappear upside down and bounce around the bottom-right corner of the stage.
To stop the cat, click once on the script or click on the stop sign above the stage.
The following screenshot shows...