Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more.

Transcript

(funky music)

Hello again computer scientists.

Welcome 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 are 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 the code runs, if the mouse pointer touches the sprite, then it hides.

Else and sprite shows.

Conditionals are used all the time in role playing games, or RPG's.

RPG's 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 player's 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.

Then sign in to scratch.

(upbeat music)

Click Remix.

Then choose a main character for the audience to control.

You can choose whichever main character you want for your story.

In this interactive story, the main character must choose whether or not to walk through a secret door.

Which decision that 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 encounter 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.

(happy music)

Now it's your turn.

Click the starter project, sign in, and click Remix.

Choose a main character for your story.

Then select two additional backdrops.

Then 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.

Instructions
  1. Open the starter project.
  2. Remix the project.
  3. Sign in to Scratch.
  4. Choose a main character for the story.
  5. Choose two backdrops for the story.
  6. Select the brick wall backdrop.
Attributions
  • "Cell phone Vibrating Sound" by freeSFX (http://www.freesfx.co.uk)
  • "Energy" by bensound.com (http://www.bensound.com/royalty-free-music/track/energy)
  • "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
  • "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