Follow the Mouse

or

Follow Another Object

We will make the dog chase the cat (which is moved by the mouse)

Make 2 sprites, named dog and cat

Go to the variables tab and make 2 variables, named Cat X pos and Cat Y pos.  These will be used to store the x and y coordinates of the cat.

Make scripts as below:

Cat Script Dog Script

Now the dog should follow the cat, which can be moved with the mouse.


To Change an Image on Mouse Over


How To Make an Image Grow Larger and Smaller Repeatedly


Move a Sprite to a Random Position


Choose a Random Pen Colour

There are 200 different pen colours.


Find a sprite that is hidden somewhere

Hold Shift, as you click on the sprite's thumbnail in the sprite list.


To Find Out What a Block Does

Right click on it and choose Help


Move a Sprite and its scripts from one project to another.

In the first project, right click on the sprite you want to move and choose Export this sprite.  Save it somewhere. 

In your new project, click on Extras , then choose Import Sprite


Move all the Sprites and their scripts from one project to another

Click on Extras then choose Import Project.


Make a sprite face in the direction it moves

 

 Use the Rotation Style buttons
Sprite will rotate as it moves
Sprite will flip to the right and left in the direction it is moving
Sprite won't rotate at all, even if the sprite changes direction.