4. Tell a Story
Now that you have an animated setting for your story, you'll add two characters and sequence dialogue between them.
To start, select a boat for your story.
Click the boat sprite and click the Costumes tab.
There are four costumes here that you can choose from.
Click one to select it.
Next, choose two characters to put on this boat.
Click Choose Sprite from Library and select your first character.
These characters will be on a boat together, so think about what kind of story you want to tell.
What two characters would be interesting to put on a boat together?
Maybe they're two characters who don't get along or who might not agree on where they're going.
Maybe they ended up on the boat by accident.
Once you have one character, add another.
To flip a sprite so that the two sprites are facing, click the Costumes tab and the Flip Left Right button.
Click and drag the characters around the stage to move them.
The characters will be in front of the boat when you do this.
To fix this, program the boat and the water to go to the front of the stage.
Click the boat, this sprite is already programmed to go to the front, then go back one layer.
Click the water sprite and add a Go to Front Block from the Looks menu under the When Flag Clicked.
Click the flag to test it out.
Great, your two sprites look like they're in the boat.
Select one sprite to start your dialogue, then from the Looks menu, drag out a Say Block.
Click to run this.
The first sprite should say hello.
Change the value of this block to the first sign of dialogue in your story.
How will this character start your story?
Consider why these characters are in a boat together.
Are they stuck, going on a cruise, looking for treasure?
Think about the story you want to tell before you start to write dialogue.
This example says, "I think we're lost."
Next, select the other character sprite.
Drag out a Say Block and write the next piece of dialogue.
How does this sprite respond to what the other character said?
This example sprite says "What makes you say that?"
But your project should tell your story.
To run these blocks, you have to click them.
Remember from earlier, that you can make code run when the flag is clicked.
Add a When Flag Clicked Event to each Save Block.
Click the flag to test.
There is the wave animation and both sprites start talking.
They talk at the same time.
Two characters talking at the same time is hard to follow.
To fix this, add a Wait Block before the When Flag Clicked Block for the second character who talks.
Each character talks for two seconds now, so change the value of this block to two seconds.
Click the flag to test.
Awesome, one sprite talks and the second one responds.
Continue the character's conversation using Say and Wait Blocks.
Click back on the first sprite that talks and add a Wait Block and change the value to two seconds, then add another Say Block.
While you sequence dialogue between the two sprites, test often so you catch mistakes as they happen.
If two sprites talk at the same time, move your code and the order that it runs to help find the bug or unexpected behavior.
Continue to build as complex of a story as you'd like.
After you've told your story, move on to the next page to learn about more ways to add code to this project using the add-ons.
Now it's your turn, add two sprites, then add a Go to Front Block to the water sprite.
Add a When Flag Clicked and Say Block to the first sprite to make it talk, then add When Flag Clicked, Wait and Save Blocks to the second sprite to make it talk.
- Add two sprites.
- Add a "go to front" block to the water sprite.
- Add "when flag clicked" and "say" blocks to the first sprite to make it talk.
- Add "when flag clicked," "wait," and "say" blocks to the second sprite to make it talk.
- Continue to build your dialogue until you've made a story!
Sign in to save your project and track your progress.