Hey and welcome to day two of CS First, Scratch Games! Today, you are going to learn abouta computer science concept while coding a racing game. This concept is called Events.
An event is something that causes an action. Events can be key presses, mouse clicks, ormessages sent from one part of a computer program to another.
An event can be written as a sentence like this: When this event happens, do this action.
Take a look at how events are used in the popular video game Minecraft. In Minecraft,the user controls a character that can fight monsters, mine resources, and build things.
Minecraft could not be programmed without events. Here are some examples.
When the user presses the space key, the character jumps.
When the user presses the “w” key, the character moves forward.
When the user scrolls the mouse wheel, the character selects a new tool to use.
When the user clicks on a tree trunk, the character starts collecting wood from thetree. Now, take a sneak peek at the game you willcreate today! This project has a race track backdrop andtwo sprites. It is a two-player game, where each player controls a sprite. The objectof the game is to be the first to make it around the track.
In this video, you’ll learn how to open a starter project and sign in to Scratch.
After you’ve finished watching this video, it will be your turn to do the same. Timeto get started!
Take a moment now to make sure you are signed in to the cs first website using the usernameand password from your passport. If you are *not* signed in, you won’t receive a digitalbadge for completing this activity, so be sure to sign in!
Next to this video, you should see a link that reads, “Racing Game Starter Project.”
Clicking this link will open a Scratch project with a racetrack backdrop in a new tab. Ifyou want to switch back to this video, click the CS First tab.
Click remix, and enter your sign-in information. Now, it’s your turn. Click the starter projectlink next to this video, click remix, and sign in.
Once you’re done, switch back to this tab and click the green arrow to watch the nextvideo.