Hello again, computer scientists! Welcome to Day 6 of CS First! Today you will create an Interactive Adventure Story while you learn about an important computer science concept: conditionals. Conditionals are the way computers make decisions.
In most computer languages, conditionals start with the word “if,” so they’re sometimes called if statements. “If” statements can be read like, “If something is true, then do this action.” Like, “If it’s raining, then use an umbrella,” or “if my phone receives a message, then it will vibrate.”
Take a look at this Scratch project that uses another type of conditional called an “If/else statement.” This code can be read: “If touching the mouse pointer, then hide. Else, or otherwise, show.” So when this code runs, if the mouse pointer touches the sprite, then it hides. Else, the sprite shows. Conditionals are used all the time in role playing games, or RPGs. RPGs are a type of interactive story, like the one you will create today. They allow the user to decide what will happen next in the story. A popular RPG, Pokemon, is programmed to use if/else statements like this: When you encounter a wild Pokemon, IF you choose “fight,” then you begin a battle with the Pokemon. Else, if you choose “run,” then you try to run away from the battle. Role playing games like Pokemon are fun because the players’ decisions affect the outcome of the story. That interactive play is made possible by if/else statements and computer science.
In today’s project, you will create a story that the audience can control, just like the role playing game described earlier. The audience chooses whether or not the character will go through a secret door. Once through the secret door, the story is all yours to create.
This video will introduce remixing and designing your story. Watch this video to learn how to do it, then try it on your own. To start your story, click the starter project link next to this video. Click remix and sign in to Scratch.
Then, choose a main character for the audience to control. You can choose whichever main character you want for your story. To see a list of walking or flying sprites, select “walking” or “flying” on the theme menu.
In this interactive story, the main character must choose whether or not to walk through a secret door. Which decision the character makes will determine the story’s backdrop, or world. You need to add two backdrops to your story to make this work: one that the character will encounter if it walks through the secret door, and one it will be in if it chooses not to go through. When you’re finished, reselect the brick wall from the backdrops menu to make sure the story starts there.
Now it’s your turn: Click the Starter Project, remix it, and sign in.
Choose a main character for your story.
Select 2 additional backdrops. Reselect the brick wall backdrop.
In the next video, you’ll get your character to ask the audience a question, where the answer will determine what happens next.
- Open the starter project.
- Remix the project.
- Sign in to Scratch.
- Choose a main character for the story.
- Choose two backdrops for the story.
- Select the brick wall backdrop.
- "Pokemon Red Game Boy Intro and Pallet Town" by darkmurkrow (https://www.youtube.com/watch?v=9giCebGY8-s) -- Licensed by Creative Commons Attributions-Share 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video trimmed to needed length | Video cropped on left and right sides
- "Umbrella Open" by Fornax (https://commons.wikimedia.org/wiki/File:Umbrella_opened.svg) -- Licensed by Creative Commons Attributions-Share 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Image scaled down
- "Green Screen Effects Rain Free HD 1080p" by vbkingofvideo (https://www.youtube.com/watch?v=-Kg7iQm7ThE) -- Licensed by Creative Commons Attributions-Share 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video trimmed to needed length
- "Pokémon the Movie: Diancie and the Cocoon of Destruction English Trailer" by BagoGames (https://www.flickr.com/photos/bagogames/13703076433) -- Licensed by Creative Commons Attribution 2.0 Generic (https://creativecommons.org/licenses/by-sa/2.0/) -- Image scaled up, cropping edges
- "Cell phone Vibrating Sound" by freeSFX (http://www.freesfx.co.uk)
- "Energy" by bensound.com (http://www.bensound.com/royalty-free-music/track/energy)
- "If Else" by EmmyNoether (https://scratch.mit.edu/projects/23875878/#editor) -- Licensed under CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0/)