In this lesson you will learn the basics of creating a platformer game in Scratch.
Go to the Scratch website, create a new project and delete the cat sprite.
Go to the Scratch website using the link below and click on the 'Create' link in the blue bar at the top.
By default, each new project starts with the cat sprite already added. To delete the cat click on the x in the blue circle beside the cat in the sprite list.
In the game you will control a sprite that moves through the platforms. Paint a new sprite and give it two costumes, one costume with the eyes looking right (call this costume "right") and one costume with the eyes looking left (call this costume "left").
You can design your sprite however you wish but for this example we will just use a simple box character with eyes.
You can create your own sprites using the sprite editor. To create a new sprite put your mouse over the Choose a Sprite button and then click on the paintbrush.
This create a blank sprite and will open the sprite editor where you can use the tools to create your sprite. You can even create extra costumes for your sprite!
Tip: give your sprite a name so that you can recognise it in the code blocks.
For the platforms we will create a sprite that has multiple costumes. Each costume of the sprite will have boxes that we will draw that will act as the platforms.
For now just create the new sprite and "design" the first costume with a box that covers all of the screen.
In a later step, we will create some more costumes of this sprite with different platforms.
You can create your own sprites using the sprite editor. To create a new sprite put your mouse over the Choose a Sprite button and then click on the paintbrush.
This create a blank sprite and will open the sprite editor where you can use the tools to create your sprite. You can even create extra costumes for your sprite!
Tip: give your sprite a name so that you can recognise it in the code blocks.
Now let's create three variables that we will be using in our code:
Once you have created these variables, add the following code to your character sprite. This code will setup the game for the start.
Now let's apply some gravity to our character! If they are up in the air and not touching the ground, they should fall down. Add the following new code to your character sprite: