- Learnt28 min · a story map, buttons, clicks, a message per path, hiding
- Basic24 min · build the fork and both paths
- Challenge 1–327 min · a third way, a second fork, a way back
- Extrabonus · choose with the keyboard
Review — where we got to 5 min
- A story is a row of scenes. Each scene is started by a message.
broadcast [forest scene v] and waitwaits until the scene is over. Plainbroadcast [forest scene v]does not.when backdrop switches to [Forest v]puts each character in place.
Quick-fire
The Wizard runs broadcast [hall scene v] and wait. The Dragon’s lines are under when backdrop switches to [Castle 3 v]. Does the Wizard wait for the Dragon?
Reveal the answer
No. Broadcast and wait only waits for scripts the message started. The Dragon’s lines belong under when I receive [hall scene v].
Today’s Topic 3 min
- A story map: where the story splits
- Button sprites with words on them
when this sprite clicked- One message for each path
- Hiding every button once a path is chosen
Learning outcome
By the end of this lesson you will be able to:
- Make a button that sends a message when it is clicked.
- Split a story into two paths, each with its own backdrop.
- Hide every button as soon as the reader has chosen.
Learnt — a story that splits 28 min
Draw the story map
Last lesson the story went one way. Today it splits in the forest. Draw it before you build it:
forest scene
|
fork
/ \
The Woods The Lake
| |
woods scene lake scene
| |
hall scene "Gobo plays with the fish."
| |
The end! The end!The place where it splits is a fork. Each way out of it is a path. Every box on the map will be a message.
Make a button
- Choose a Sprite → Button2. It is the wide one.
- Open the Costumes tab.
- Pick the T (Text) tool. Click on the button and type The Woods.
- Rename the sprite Woods button.
- Right-click it and choose duplicate. Change the words to The Lake, and the name to Lake button.
The storyteller stops at the fork
The Wizard’s flag script gets shorter. It tells the first scene, then shows the fork:
when flag clicked
switch backdrop to [Forest v]
broadcast [forest scene v] and wait
broadcast [fork v]
A button that listens and clicks
Each button hides at the start, and shows at the fork. Clicking it sends its own message.
- Click the Woods button in the Sprite list.
- Open Events.
- Drag out
when this sprite clicked. - Add
broadcast [go woods v]. Make the message with New message.
when flag clicked
hide
when I receive [fork v]
show
when this sprite clicked
broadcast [go woods v]
Gobo wonders while the reader decides:
when I receive [fork v]
think [The woods or the lake?]
One message for each path
The Wizard picks the story up again, from whichever message arrives:
when I receive [go woods v]
switch backdrop to [Woods v]
broadcast [woods scene v] and wait
switch backdrop to [Castle 3 v]
broadcast [hall scene v] and wait
say [The end!] for (2) seconds
when I receive [go lake v]
switch backdrop to [Underwater 1 v]
broadcast [lake scene v] and wait
say [Gobo plays with the fish all day.] for (2.5) seconds
say [The end!] for (2) seconds
Hide every button
Once the reader has chosen, both buttons must go — not only the one clicked.
when I receive [go woods v]
hide
when I receive [go lake v]
hide
How to use this: Click the green flag. When the two buttons appear, click The Woods or The Lake.
What if a button forgets to hide? Try it and see:
How to use this: Click the green flag. When the buttons appear, click The Woods, then click The Lake straight away.
Basic — build the fork 24 min
Step 1 — new places
Open your story from last lesson. Add the Woods and Underwater 1 backdrops. Add the Fish sprite.
Step 2 — the Wizard asks
Change the Wizard’s forest scene so it ends with the question:
when I receive [forest scene v]
say [This is Gobo. Gobo lives in the forest.] for (2.5) seconds
say [Which way should Gobo go? You choose!] for (2.5) seconds
Step 3 — the storyteller stops at the fork
Make the Wizard’s flag script the short one from Learnt.
Step 4 — two buttons
Make the Woods button and the Lake button. Drag the Woods button to about (−110, −150) and the Lake button to about (110, −150).
Step 5 — the buttons’ scripts
Each button has five stacks. The Woods button:
when flag clicked
hide
when I receive [fork v]
show
when this sprite clicked
broadcast [go woods v]
when I receive [go woods v]
hide
when I receive [go lake v]
hide
Step 6 — the two paths
Give the Wizard the go woods and go lake stacks from Learnt.
Step 7 — Gobo and the Fish
when I receive [woods scene v]
say [It is so quiet in the woods.] for (2) seconds
say [Look! I can see the castle!] for (2) seconds
when I receive [lake scene v]
say [Splash! I can swim!] for (2) seconds
say [Hello, fish!] for (2) seconds
when backdrop switches to [Woods v]
go to x: (0) y: (-110)
when backdrop switches to [Underwater 1 v]
go to x: (-40) y: (-20)
when backdrop switches to [Forest v]
hide
when backdrop switches to [Underwater 1 v]
show
Step 8 — test both paths, then try to break it
Play it twice: once to the castle, once to the lake. Then click as fast as you can at the fork. Only one path should ever run.
How to use this: Click the green flag. When the buttons appear, click The Woods or The Lake. Play it again and pick the other one.
The buttons are there before the fork.
The when flag clicked + hide stack is missing on one button. Check both.
Clicking a button does nothing.
The Wizard listens for go woods, but the button broadcasts a different message. Open both dropdowns and compare them letter by letter.
One button stays on the screen.
That button hides on its own message but not on the other one. Each button needs both hide stacks.
The fork appears while the Wizard is still talking.
The flag script uses plain broadcast [forest scene v]. It needs the and-wait block, so the fork comes after the question.
A third way
- Add a Go Home button between the other two.
- It takes Gobo to the Bedroom 1 backdrop, where he says two lines.
- Clicking any of the three buttons hides all three.
How to use this: Click the green flag. When the three buttons appear, click Go Home, The Woods or The Lake.
Teacher reveal
A third message, go home, and a third path stack on the Wizard. The part most pupils miss: every button now needs three hide stacks — one for each path. Two buttons that do not know about go home stay on screen in the bedroom.
A second fork
- After the woods scene, the story stops again.
- Two buttons: The Castle and The Lake.
- The Castle goes to the hall. The Lake joins the lake path you already have.
How to use this: Click the green flag. Click The Woods at the first fork, then click The Castle or The Lake at the second.
Teacher reveal
when I receive [go woods v]
switch backdrop to [Woods v]
broadcast [woods scene v] and wait
broadcast [fork 2 v]
The Wizard’s woods path now ends at a second fork. The Lake button gets one more stack, when I receive [fork 2 v] + show, and a new Castle button sends go castle. The point to draw out: a message is not used up. go lake can be sent from two places.
A way back
- The lake is no longer an ending.
- After the lake scene, a Go Back button appears.
- It takes Gobo back to the forest, and the fork appears again.
How to use this: Click the green flag. Click The Lake, then Go Back when it appears, then The Woods.
Teacher reveal
when I receive [go lake v]
switch backdrop to [Underwater 1 v]
broadcast [lake scene v] and wait
broadcast [lake done v]
when I receive [go back v]
switch backdrop to [Forest v]
broadcast [fork v]
On the Wizard. The Go Back button shows on lake done, sends go back and hides on it. The fork buttons need no change at all: sending fork again shows them again. This is the first story with a loop in its map.
Choose with the keyboard
- At the fork, 1 picks the woods and 2 picks the lake.
- Clicking still works.
- Pressing 1 or 2 at any other time does nothing at all.
How to use this: Click the green flag, then click the stage once. At the fork, press 1 for the woods or 2 for the lake.
Summary 3 min
- Draw the story map first. Every box becomes a message.
- A button is a sprite with words painted on it.
when this sprite clicked+ a broadcast is a choice.- The storyteller stops at the fork. The reader’s click starts the next part.
- Every button hides on every path’s message. Then only one path can run.
- Fork
- The place where a story splits.
- Path
- One way through the story.
- Branch
- When a program goes one way or another, depending on a choice.
- Story map
- A drawing of every scene and every fork, made before you build.
Hand in
Save your story and send it to your teacher. Next lesson, the story remembers what the reader picked up.