In this video, you'll add short introductions that will play at the start of your game andwhen the character arrives in each setting. These introductions will include text thatdescribes 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 textthat introduces your story. You might describe the setting and the problem the characterhas 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 onthe problem introduced in the first slide, or tell why the sprite needs to find thisobject. 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 thatwill send them off on their quest. Once you write text for all three, considercustomizing the slides by changing the color or font of the words, or by changing the slidecolor with the “color a shape” tool. Next, program these slides to appear at thestart of the game. Click the scripts tab. Add a “show” blockand a “go to front” block to make the slide appear in front of all the other elementson 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, switchcostume 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 readthe 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 timeto 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 thissprite say when it enters this new space? Remember that the sprite is looking for anobject, so maybe this text explains why the object can’t be in this location, or showsthat the sprite is scared, happy, or frustrated. Add as many “say” blocks as you need totell this part of your story. Click the flag to try it out. Use the arrowkeys 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 likepart 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 furthercustomize 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 threecostumes to introduce your story. Program the slides to show using "when flagclicked," "show," "go to front," "switch costume," "wait," and "hide" blocks.
Make the character sprite say something using “when backdrop switches” and “say”blocks.