Displaying a score gives the player feedback on their progress in the game, including a way to track their personal best as a challenge to improve in the next match. This movie shows how to create a score in a game, and how and when to add to the score. Creating a score is done by making a score variable and adding to it when the player catches an apple.
- [Voiceover] To wrap up our game, we're going to keep track…of how many apples the player catches…and display that information on the screen.…Let's head over to the Apple2 sprite.…So, what we're going to do here is just,…create a variable, that's called Score…that's just going to keep track…of how many apples were caught.…So we go over to Events and then…I'll drag out a when green flag clicked.…Now, in here we're going to set our score variable to 0.…So let's go over to Data and create a score variable.…
So, we go to make a variable,…and this could be For all sprites or For this sprite only.…It doesn't really matter.…So I'm going to leave For all sprites as the default.…So this can be accessible by other sprites…if we ever wanted to do that.…Now, for our game right now,…we're not going to make this accessible by other sprites.…But if you ever wanted to remix this,…you could do that as well.…So I'm going to add the variable named score…and then click OK.…So there's our score variable and we don't want it…showing on our screen like that,…
He starts with demonstrating how to create your first project and gather the artwork (aka sprites) and other assets you'll need to build it. Todd then reviews the prebuilt scripts, the bits of code that control the logic of your Scratch projects, and explains how to use the different script types for different functions, such as animating sprites, responding to events such as button clicks, and comparing values. In chapter 3, he covers costumes, and in chapter 4, he shows how to load and play sounds. Finally, he shows how to put it all together into a complete web game, which you can then share with the Scratch community.
- What is Scratch?
- Creating your first project
- Choosing a backdrop for your application
- Creating sprites (reusable graphics) in Scratch
- Working with scripts: animating objects, responding to events, and checking logic
- Switching sprite costumes
- Changing the appearance of sprites with custom-drawn costumes
- Playing sounds
- Building a game with Scratch
Skill Level Beginner
Teaching iOS Programming to Kidswith Todd Perkins1h 1m Beginner
1. Get Started with Scratch
5. Build a Game
Next steps2m 36s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.