Welcome to activity 4 of Scratch Games! Today you will create a platform game.
In this type of game, a sprite moves across raised platforms or obstacles. Some popular platform games are Super Mario Brothers, Donkey Kong, and, more recently, Doodle Jump.
One of the earliest platform games, Donkey Kong, uses if statements and events.
In Donkey Kong, a character named Mario must rescue another character while climbing a tower and avoiding Donkey Kong’s barrels. In activity 2, you learned how computer scientists use events to tell a computer when to run code or complete an action. Donkey Kong uses events to make actions happen in the game: When the user presses the right arrow, Mario moves right. When the user presses the left arrow, Mario moves left. When the user presses the space key, Mario jumps.
Donkey Kong also uses “if statements.” You used If statements when you built the Maze Game in activity 3 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 not touching a platform, then he falls. If Mario touches a barrel, then he loses a life If Mario reaches the sprite, then user wins the game. In your platform game, a sprite will jump onto platforms to reach another sprite. The game you’ll create is similar to Donkey Kong and uses the same types of events and “if” statements in the code.
In this game, the sprite moves when the arrow keys are pressed. If the sprite is not touching a platform, then it falls until it does. If the sprite reaches the sprite at the top of the platforms, then the user wins. To get started, open the starter project by clicking on the link on this page. Click remix, and sign in. If you don’t click remix or sign in, your work won’t be saved, so make sure you complete this step.
Next, add two sprites to your project.
Click “choose new sprite” from library, and choose a goal sprite. What object will your main character need to reach?
Then, click “choose new sprite” and select a main character for your game.
There are many different combinations of sprites that you can use to make your game fun and unique.
The example project will use a monkey and bananas.
After you choose sprites, arrange them on the screen in a way that makes sense for your game. For example, in this game the monkey needs to get to the bananas, so it makes sense to drag the monkey to the bottom of the screen and drag the bananas to the top platform.
To change the sprites’ sizes, choose either the “shrink” tool or the “grow” tool, and click on the sprite. When you’re done setting up how your game will look, return to this screen and click the green arrow to move on to the next video.
Now, it’s your turn: 1) Open the platform starter project.
2) Click remix, and sign in. 3) Add two sprites, and position them correctly for your game.
- Open the starter project on the CS First Page.
- Click remix and sign into Scratch.
- Arrange the sprites on the screen in a way that makes sense for your game.
- "Super Mario Bros. Speedrun 9:00 (2009)" by TheRollinStoned (https://www.youtube.com/watch?v=ZzV8NBHu2TY) -- Licensed by Creative Commons Attribution 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video trimmed to needed length | Audio removed | Video scaled up, cropping edges
- "FreeKong" by Free Video Games Project (http://www.freekong.org/welcome.php) -- Game cropped from website
- "我們來玩DOODLE JUMP" by Ben Ten (https://www.youtube.com/watch?v=LhZM2Zuzbkk) --Licensed by Creative Commons Attribution 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video turned 90 degrees | Audio removed | Video compressed down to fit screen fully
- "Donkey Kong (Coleco/ColecoVision 1982)" by William Hunter (https://www.youtube.com/watch?v=0yDWuhkHHpw) -- Licensed by Creative Commons Attribution 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video trimmed to needed length | Audio removed | Video scaled up, cropping edges
- "PlayStation Down Button" by VictorPines (https://commons.wikimedia.org/w/index.php?title=File:PlayStation_Down_button.svg&redirect=no) -- Licensed by Creative Commons Attribution-Share Alike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/deed.en) -- No modifications made