The big ideaA story program has scenes, and messages tell each sprite its turn.
How it works
A story program has scenes. A scene is a backdrop with sprites on it, and the backdrop is the picture behind them.
If every sprite starts on the flag, they all talk at once. Messages give them turns.
One sprite broadcasts a message, and the others wait. The sprite that receives it knows it is its turn.
A switch backdrop block changes the scene at just the right time.
The dragon's blocks and the cave's blocks.
Example 1: Everyone at once
Mira makes every sprite talk when the flag is clicked.
The dragon, the mouse and the owl all talk at the same moment.
Nobody can follow the story, so the sprites need turns.
Example 2: Taking turns
The dragon speaks and then broadcasts a message.
The mouse receives it, answers, and broadcasts the next message.
The owl receives that one and has its turn.
Example 3: Changing the scene
At the end the dragon broadcasts cave.
The cave scene starts with when I receive cave, and then switches the backdrop.
Out go the trees, and in comes a cave full of crystals.
Example 4: A stuck story
The dragon says Follow me! and its blocks end, with nothing sent.
The cave scene waits with when I receive cave, but nobody ever broadcasts cave.
The mix-up to fix: add a broadcast cave block to the dragon's stack.
Words to know
scene
A backdrop with sprites on it.
backdrop
The picture behind the sprites.
broadcast
Sends a message to the other sprites.
when I receive
Waits for a message, then starts.
switch backdrop
Changes the scene.
Watch out
A sprite does not know its turn without a message or a block.
A broadcast with no matching when I receive does nothing, and a when I receive with no broadcast waits for ever.
A louder sprite or a bigger stage does not give anyone a turn.
Switch backdrop changes the scene, not the sprites' names.
Try it
What gives sprites their turns: messages or a bigger stage?
Which block sends a message: broadcast or when I receive?
What does a switch backdrop block change?
The cave scene starts with when I receive cave, but nothing broadcasts cave. Will it start?
What is a backdrop?
Answers: 1. Messages · 2. broadcast · 3. The scene · 4. No · 5. The picture behind the sprites
Try at homePick a short story with two characters. Each of you says one line, then looks at the other: that is the broadcast. Wait for the look before you speak, like a sprite waiting for a message. Then try it with no looking, and see what happens.
For grown-upsDo the Mission: pick a short story with two characters and each say one line, then look at the other. That look is the broadcast, so wait for it before you speak. Then try it with no looking and see what happens.
Open these notes on screenScan the code, or go to tutorpip.com.