Making Sprites Move Automatically
Having a sprite move around without any user control can be useful, and is often a key part of a game. The method used is similar to that shown in moving with keys 2.
The key differences are that the direction is set to a random one at the start and the sprite is asked to bounce back of the edges of the screen
The basic idea is you give the sprite a direction and then ask it to move a number of steps. The forever loop keeps it repeating the number of steps.