GoalPlan and read an animation in which two sprites each have their own script.
New words
backdrop · the picture behind the sprites on the stagescript · a stack of blocks that starts with a hat blockscene · one animated picture made of a backdrop and sprites
Explanation
An animation scene has a backdrop and one or more sprites. Each sprite has its own script, and all the scripts that start with “when green flag clicked” run at the same time. So an owl can change costume while a moth moves. Before you write the scripts, plan each sprite: its start place, what repeats and what changes. The “start sound” block plays a sound and the script carries on at once. Put it before the forever block so the sound starts once. When you finish, compare the scripts: which blocks are the same and which are different? Loops are everywhere in nature too, such as day and night, the tide and the seasons.
Sprite
Start place
What repeats
owl
x: −100, y: 60
changes costume every 1 second
moth
x: 80, y: −20
moves 20 steps right and 20 back
Worked examples
Both scripts start with the green flag. The owl only changes costume. The moth plays a sound once, then moves to and fro. They run at the same time.
Time
Moth x
0 s
100
0.5 s
80
1 s
100
1.5 s
80
This table shows where the moth is. It moves 20 right at once to x: 100, waits 0.5 seconds, moves back to x: 80, waits, and so on. One round takes 1 second.
Nature is full of loops. Day follows night and night follows day. The tide comes in and goes out and comes in again. The seasons come round every year.
Class activity
Plan a scene (with a friend): fold a sheet of paper in half. At the top, draw a backdrop such as a night garden, a beach or a playground. Draw two sprites. For each one write the start place (x and y), what repeats and how long it waits. Swap plans with your friend and act out both scripts at the same time when you both say “Flag!”. Does the scene look right? If you have a computer or tablet, build the scene in Scratch and add comments.
Practice
1
Which sprite changes costume, and which one moves to and fro?
The turtle changes costume. The rabbit moves to and fro.
2
Both scripts start with “when green flag clicked”. Do they run one after the other or at the same time?
At the same time.
3
Which block fills the gap so that the bell swings to the right and then back to the left, again and again?
turn ↻ (20) degrees
4
Give two examples of loops in nature.
For example: day and night, the tide, the seasons or a heartbeat.