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