Playable result only — the source code stays hidden.
Mission 0: See What You’re Building
Before you start coding, play the finished Catch the Falling Star game.
Watch what happens when you move the basket, catch a star, miss a star, win, lose and restart. Then you will build the same game from a nearly blank canvas, one small feature at a time.
What you’ll practise
- variables and changing values
- keyboard input
if,else ifandelse- random positions
- collision checks with
&& - strings and numbers for score and lives
- functions for organising a larger program
What you’ll build, mission by mission
- 1Build the basket
Draw the player basket and store its position in a variable.
- 2Move the basket
Use the arrow keys to move it left and right.
- 3Drop a star
Add a falling object whose position changes every frame.
- 4Reset the star
Send the star back to the top at a new random x position.
- 5Catch the star
Detect when the falling star reaches the basket.
- 6Keep score
Add one point for each catch and display the score.
- 7Add three lives
Lose a life when the star reaches the bottom.
- 8Win or lose
Give the game clear winning and game-over states.
- 9Restart the game
Press R after the game ends to reset all the important state.
- 10Organise the game
Move working code into clear functions so the final program is easier to read.