arrow_back Change of Scene
In this add-on, you'll add a scene to the end of your story, and stop your character's walk.
Click the Stage and then the Backdrops tab to see the additional backdrops, or scenes, included in the starter project. You can also choose a backdrop from the Scratch library, draw your own backdrop, or upload one from your computer. Decide on a backdrop for your next scene. This example will use the "bedroom" backdrop, but you will use one that fits your story.
To add the backdrop to the end of your story, click on the Character sprite, click on the Looks menu, then drag the "Switch backdrop to" block to the end of your block stack. Choose the backdrop you will use from the dropdown menu in the “Switch backdrop” block.
Try it out.
Great. The scene changed, but the character is still moving up and down like it is walking, and the table from the store scene still displays. To hide the table, click on the table sprite, click on the events menu, and drag out a "When I receive" block. In the dropdown menu, choose New Message. Enter something descriptive like "Next Scene." From the Looks menu, add a "hide" block, then click the block stack to test it.
Great! The table disappears.
Click on the character sprite again and the events menu, and drag a "broadcast" block into your code stack. Choose the message you just added from the dropdown. In this example that’s "Next Scene." Now, when this broadcast block is run, the "Next Scene" message will broadcast and the table will hide. Next, to stop the character sprite from moving up and down like it is walking, click the Control menu, and drag out a “Stop” block.
From the dropdown, choose "Other scripts in this sprite." This will stop any other code block stacks, called scripts, from running. Click it to try it out.
Great! The character stops moving. Connect the “stop” block to the end of your stack.
Try the whole project again to look for unexpected problems.
First, the story is told in the store.
Then, the backdrop switches. The "Next Scene" backdrop is broadcasted, which tells the Table sprite to hide, and finally the other code in the Character sprite is stopped, so the character stops walking. Great!
Of course, the character also needs to react to the new scene. What will your character do or say next? Where will your story go?
Now, it's your turn. Use the “switch backdrop” block to change the scene, broadcast a message to the table to hide, then use a “Stop” block to stop your character's walk.