Page 59 - Computer - 5
P. 59
Programming Two Sprites
You can create a separate script for each sprite in a project. Each sprite executes its
own script when you run the project.
Lab Activity 1
Experiential Learning
Let us move two butterflies on the Stage.
1. Create a new project.
2. Delete the Cat sprite.
3. Add the Butterfly1 and Butterfly2 sprites from the
Animals category in the Sprites Library.
4. Position the sprites on the Stage as
shown in the image.
5. Select the Butterfly1 sprite in the
Sprites list and create the stack of
blocks as shown in the image.
6. Select the Butterfly2 sprite in the
Sprites list and create the stack of
blocks as shown in the image.
7. Click the Go button to execute the project.
The butterflies start moving around the Stage.
A sample image is given for your reference.
8. Click the Stop button to stop the project.
CHANGING COSTUME OF A SPRITE
A Costume is a specific appearance for a sprite. The Costumes tab displays all the
costumes for the selected sprite. By default, a sprite uses only one costume. You can
create animation in a project by changing the costumes of a sprite quickly. The Looks
blocks help you change the costume of a sprite.
To view the costumes for a sprite:
1. Select the sprite in the Sprites Info pane.
2. Click the Costumes tab.
All the costumes for the sprite are displayed.
57