LEARN · PRACTISE · DISCOVER
Final Project: Build a Catch Game
This is it: your final project! You will build a complete catch game. Apples fall from the sky, and you move a bowl to catch them. Each catch scores a point. You will use every skill from this course: sprites, motion, events, loops, if-then, variables, random numbers and broadcasts.
Build the game
Step 1: set the scene
- Choose a backdrop, such as Blue Sky.
- Delete the Scratch Cat.
- Add a Bowl sprite and an Apple sprite from the library.
- Make a variable called Score for all sprites.
Step 2: code the bowl
The bowl sits near the bottom and follows the arrow keys.
when green flag clicked
set [Score] to (0)
go to x: (0) y: (-150)
forever
if <key (right arrow) pressed?> then
change x by (8)
end
if <key (left arrow) pressed?> then
change x by (-8)
end
endStep 3: code the falling apple
The apple starts at a random spot at the top and falls down. If the bowl catches it, the score goes up. Either way, it goes back to the top.
when green flag clicked
go to x: (pick random (-220) to (220)) y: (170)
forever
change y by (-5)
if <touching (Bowl)?> then
change [Score] by (1)
start sound (Pop)
go to x: (pick random (-220) to (220)) y: (170)
end
if <(y position) < (-170)> then
go to x: (pick random (-220) to (220)) y: (170)
end
endy position is a reporter block in Motion. When it is below -170, the apple has hit the ground.
Test and debug
Click the green flag and play. Does the bowl move? Does the score go up? If something does not work, read your script one block at a time. Check names, numbers and the order of blocks. Finding and fixing bugs is called debugging, and every coder does it.
Finish and polish
Step 4: add a timer and an ending
Add the countdown timer from Lesson 9 to the Stage, with a Time variable that counts down from 30 and then broadcasts game over. Then give the bowl this script:
when I receive (game over)
say (join (Final score: ) (Score))
stop (all)The join block, in Operators, sticks words and numbers together.
Step 5: make it yours
- Make the apple fall faster as the score goes up.
- Add a bad object, like a rock, that takes away a point.
- Add background music to the Stage.
Example
Leo added a rotten apple that took away 2 points and a golden apple worth 5. His friends played it for a whole lunchtime!
Share your game
If you have an account, click Share to publish your game so friends can play. Follow the Scratch community guidelines: be kind, and never share personal information like your full name, address or school.
Key takeaways
- Real games combine many coding ideas at once.
- Variables track score; random numbers add surprise.
- Broadcasts let the game end neatly for every sprite.
- Testing and debugging are part of every project.
Practice
Build the catch game, then add one improvement of your own. Write down which coding ideas you used.
Answer: a complete answer uses events (green flag and keys), motion (x and y), loops (forever), conditionals (if touching), variables (Score and Time), random numbers (pick random) and broadcasts (game over). Any working improvement, such as a faster apple or a rock, is correct.