Day 5 Unit 2

Unit 2. Platform game – events and If-then statements

Before we start with a new game, let’s share and show the games that you have worked on last week.

Wrap up: Share your project!

  1. Click Share button on the top of the page.
  2. Click on +add to studio button at the bottom of the page
  3. Choose 2021 Race and Maze games.
  4. Click okay

Wrap-up: Show your project

  1. click on your account name at the top right of the page.
  2. Select My Class
  3. Click on Class Studios – 2021 Race and Maze games
  4. Check out your friends projects!

Today, we are building a platform game. We will use the concepts we learned last week, events and if-then statements, but the game will be a little more complex.

First we will start by watching this video.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/platform-game/platform-games-intro-and-design.html

And open up the starter project.

http://scratch.mit.edu/projects/19646592/#editor

We will use events to make the sprite jump.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/platform-game/use-events-to-make-the-sprite-jump.html

  1. Program your player sprite to jump when the up arrow key is pressed.
  2. Create a condition that says if the sprite is not touching a platform, then it should move down.
  3. Make the player sprite fall when it is not touching a platform.

Then we will make the sprite move left and right when the arrow keys are pressed.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/platform-game/move-the-sprite-left-and-right.html

  1. Create two key-press events.
  2. Add two “change x by” blocks to make the sprite move both left and right.
  3. Add two “repeat until” blocks to make the sprite move more smoothly.
  4. For each “repeat until” block, create a condition that makes the sprite move until the key is not pressed.