12: Catch the Cue Ball (Part 03)
Learning Target
- Use variables to keep track of a player score
- Display the value of a variable on the screen
Instructions
Step 1:
Open your most recent version of Catch the Cue Ball in GDevelop.
Step 2:
Save the project as "Catch the Cue Ball 03" or something like that. You can save it in the same folder as last time, but saving it with a different name means you can always return to an earlier version of the game should something go wrong.
Step 3:
We'll start by creating a variable to store a player score. This is something that should be remembered through every level, so we'll use a global variable for this.

Be sure to choose a name that clearly communicates the variable's purpose. For example:

Step 4:
Initialize the score at the beginning of the game.
Step 5:
Display the score on the screen. The video example will start playing at this step.
Step 6:
Update the score and its display whenever the player clicks on the ball. The video example will start playing at this step.
Step 7:
Save your game. Then, preview the game to make sure it is working.
Make any changes that you think are needed. Then, save your project again.
Repeat this step as needed.
Improvements:
Is there a way to make scoring more fun and interesting? Some ideas:
- Positive and negative scoring
- Objects that are harder to get but worth more score
- Power-ups
- And, many other possibilities
Grading
| Your submission... | Your grade... |
|---|---|
|
Extended
|
A+ |
|
Exceptional
|
A |
|
Good
|
B |
|
Reasonable
|
C |
|
Needs Improvement
|
D |
|
Insufficient
|
F |
| Scores may be rounded to the nearest whole number. | |