(upbeat music)
Hey! Welcome to day four of Scratch Games.
Today, you will create a platform game.
In this type of game, a sprite must move
across raised platforms or obstacles.
Some popular platform game samples include
Super Mario Brothers,
Donkey Kong,
and more recently, Doodle Jump.
Look at how if statements and events
are used in one of the earliest platform games, Donkey Kong.
In Donkey Kong, a character named Mario
must rescue another character while climbing
a tower and avoiding Donkey Kong's barrels.
First, look at how events are used in this game.
Remember from day two's racing game
that events allow computer scientists like you
to tell a computer when to run code or complete an action.
When the user presses the right arrow, Mario moves right.
When the user presses the left arrow, Mario moves left.
And when the user presses the space key, Mario jumps.
These examples all represent an important
computer science concept
you're going to work with today: events.
Events tell the computer when to run code.
Next, take a look at how Donkey Kong uses if statements.
You used if statements in day three's maze game
to instruct the computer to make decisions.
If statements look like this:
if a condition is true, then do this action.
In Donkey Kong, if Mario is touching a platform,
then he will fall.
If Mario touches a barrel, then he loses a life.
If Mario reaches the sprite, then the user wins!
The platform game that you will create today
features a sprite that must jump into platforms
to reach another sprite.
This game is similar to Donkey Kong
and uses the same types of events and if statement code.
In this game, the sprite moves
when the arrow keys are pressed.
If the sprite is not touching a platform,
then it will fall until it dies.
If the sprite reaches the sprite
at the top of the platform, then the user wins.
To get started, open the starter project
by clicking on the link next to this page.
Sign in!
(upbeat music)
Click remix.
If you don't click remix or sign in,
any work that you complete will not be saved,
so please be certain that you complete this step.
Next, add two sprites to your project.
To select a sprite, click choose new sprite from library.
You can choose whichever sprites
you would like for your project.
(upbeat music)
Then, arrange the sprites on the screen
in a way that makes sense for your game.
You can change the sprite size.
(upbeat music)
Use the time during this step to
make your project look the way you want it to look.
(upbeat music)
Then, return to the screen and click the green arrow
to move on to the next screencast.
Now, it's your turn.
Open the platform starter project.
Then, sign in to Scratch and click remix.
Add two sprites, and position them correctly for your game.
(upbeat music)