In this video, you will program the android sprite to say more about its fashion.
First, click the costumes tab. Sprites can have multiple costumes. To select a costumethat you like for your story, just click it! Next, click on the scripts tab and add another“say” block to your block stack. Type in text to continue the story and make thesprite say another statement about its fashion sense.
Think about colors, patterns, your favorite outfit, sneakers, whatever it is that youwant to share about fashion. Once you’ve added the “say” block, clickthe flag to try it out. Interesting. There are 2 “say” blocks,but the sprite only said the text from the last one! This kind of unexpected behaviorin code is called a bug.
Computer scientists test their code frequently to find bugs like this one, so they can fixthem. In this example, the bug happens because thesprite says both “say” blocks so quickly, you can't see them. To make the sprite saythe phrases more slowly, click the control menu, and drag out "wait" blocks. Place one“wait” block after each “say” block in your code stack.
Change the value in the “wait” block to set how long the sprite will pause betweenstatements. A larger number will create a longer pause, while a smaller one will makethe pause shorter. For example, enter a longer wait time if you have long sentences to giveyour viewers time to read everything your android says.
Try it out. Great! Now the sprite waits after saying each statement.
In computer science, it often takes more than one try to find the right solution to a problem.
Keep coding, testing, and trying solutions until you find the one that works.
Add more say and wait blocks to continue the story. Be creative and share what you likeabout fashion. Test your code often by clicking the flag. Great!
Take a moment now to make sure you are signed in to the cs first website using the usernameand password from your passport. If you are *not* signed in, you won’t receive a digitalbadge for completing this activity, so be sure to sign in!
Now, it's your turn! Continue your fashion story starter by addingmore “say” and “wait” blocks. After you're done, return to this tab, andclick the green arrow to learn how to customize the appearance of your sprite and more withadd-ons!