In this video, you'll add short introductions that will play at the start of your game and when the character arrives in each setting. These introductions will include text that describes the story's plot and helps the player understand what to do.
To start, click the narrative sprite. This sprite will show at the start of the story, go to the front, and introduce the player to the game’s plot.
Click the costumes tab and slide 1. Double click the text box on slide 1, and write text that introduces your story. You might describe the setting and the problem the character has to solve, which is finding the missing object.
Then click slide 2, and add more text to continue and develop the story. You might build on the problem introduced in the first slide, or tell why the sprite needs to find this object. Or, you might give clues about how to find the object.
Then, click the third slide, and give the character the last bit of information that will send them off on their quest. Once you write text for all three, consider customizing the slides by changing the color or font of the words, or by changing the slide color with the “color a shape” tool. Next, program these slides to appear at the start of the game. Click the scripts tab. Add a “show” block and a “go to front” block to make the slide appear in front of all the other elements on the screen. Click the block stack to test this.
If the sprite isn’t centered, either drag it to center it, or click the motion menu, and add a “go to x y” block. Change the values to 0 and 0.
To make the sprite cycle between the three slides, add three “switch costume” blocks.
Change the the value in each to one of the slides.
This code now reads: “go to (0,0),” show, go to front, switch costume to slide 1, switch costume to slide 2, and switch costume to slide 3.”
Click the block stack to run it. It jumps right to the final slide, so you can’t read the whole introduction. To fix this, add a “wait” block after each “switch costume” block. Tinker with the values in the “wait” blocks until they give the user enough time to read the text. Click the block stack to run this again. Awesome!
Finally, program this code to run at the start of the program with a “when flag clicked” event, and hide after it has shown using a “hide” block at the end of the stack.
Awesome! These introductory slides definitely help develop the story behind this game.
Next, program the character sprite to talk about each location it enters. To do this, click the character sprite. To run code when the sprite enters a new location, add a “when backdrop switches to” block. For the first location, select the “house” value. Then, add a “say” block. What might this sprite say when it enters this new space? Remember that the sprite is looking for an object, so maybe this text explains why the object can’t be in this location, or shows that the sprite is scared, happy, or frustrated. Add as many “say” blocks as you need to tell this part of your story. Click the flag to try it out. Use the arrow keys to make the sprite go to the “house” sprite. When the backdrop switches… great!
The sprite says phrases that tell the story of this RPG and make the player feel like part of the action. Add similar code for each location sprite.
Awesome! After you build out the story for your game, move on to the add-ons to further customize it.
Before you leave today’s club, be sure to share your project with the Scratch community, write a description, and add some project tags like “<insert theme word such as "art",story,game,fashion>.”
Now, it’s your turn: Add text to the narrative sprite’s three costumes to introduce your story. Program the slides to show using "when flag clicked," "show," "go to front," "switch costume," "wait," and "hide" blocks.
Make the character sprite say something using “when backdrop switches” and “say” blocks.
- Aggiungi del testo ai tre costumi dello sprite Narrativo per presentare la tua storia.
- Programma le slide da mostrare.
- Fai dire qualcosa allo sprite Personaggio quando lo sfondo cambia.