DIY Catch the Apple Game
A Simple Code.org Block-Based Coding Project for Grade 3
Overview
Catch the Apple is an engaging, beginner-friendly game created in Code.org for Grade 3 students. The player controls a basket at the bottom of the screen and moves it left or right to catch apples falling from the top. Each successful catch increases the score. The Catch the Apple project introduces students to sprites, keyboard events, variables, loops, random positions, and simple if conditions through a fun game.
Materials Required
- Computer or laptop
- Internet connection
- Code.org account
- Code.org Game Lab
- Keyboard and mouse
- Basic knowledge of sprites and block-based coding
Working Principle
The game uses two main sprites: a basket and an apple. The basket stays near the bottom of the screen and moves left or right when the player presses the arrow keys. The apple starts near the top and moves downward. When the apple touches the basket, the score increases by one and the apple returns to the top at a new random horizontal position. This process repeats while the game is running.
Detailed Step-by-Step Procedure
Step 1: Open Code.org
Open Code.org and enter Game Lab. Start a new project. Choose a simple game canvas and save the project with a suitable name such as Catch the Apple.
Step 2: Create the Game Sprites
Create a basket sprite near the bottom of the screen and an apple sprite near the top. Use simple images or drawings available in Game Lab so the game is easy for Grade 3 students to build.
Step 3: Add the Background
Choose a bright and simple background for the game. A sky, garden, or playground background works well. Keep the background uncluttered so the basket and apple are easy to see.
Step 4: Program the Basket
Use keyboard events to control the basket. When the left arrow key is pressed, decrease the basket’s x-position. When the right arrow key is pressed, increase the basket’s x-position. Keep the basket near the bottom of the screen.
Step 5: Program the Falling Apple
Make the apple move downward continuously by increasing its y-position. When it reaches the bottom, send it back to the top. Give the apple a random x-position so it does not fall in the same place every time.
Step 6: Add the Catching Condition
Use an if condition to check whether the apple touches the basket. When the sprites touch, move the apple back to the top and give it a new random x-position. This creates the main catching action of the game.
Step 7: Create the Score
Create a variable called score and set it to 0 at the beginning. Each time the basket catches the apple, change the score by 1. Display the score on the screen so the player can see progress.
Step 8: Add Simple Game Rules
A beginner version can use a fixed play time or a target score. For example, the player can try to catch 10 apples. An optional countdown can be added later as an extension.
Step 9: Test the Game
Run the game and check the basket controls, apple movement, collision condition, score, and reset position. Fix any block that does not behave as expected. Test several rounds to make sure the game works consistently.
Block-Based Coding Logic
The main logic can be organized into these simple Code.org blocks:
- Set the score to 0 when the game starts.
- Create the basket and apple sprites.
- Place the basket near the bottom of the screen.
- Move the basket left when the left arrow is pressed.
- Move the basket right when the right arrow is pressed.
- Continuously move the apple downward.
- If the apple touches the basket, change the score by 1.
- After a catch, move the apple to the top.
- Give the apple a random x-position.
- Continue the game loop.
Suggested Variables
- score – stores the number of apples caught.
- Optional: time Left – stores the remaining game time if a timer is added.
Expected Output
The final game shows a basket moving left and right at the bottom of the screen while an apple falls from
Applications
This catch the apple project can be used in computer science classes, coding clubs, STEM activity sessions, classroom game design activities, beginner programming workshops, and school exhibitions. It can also be extended into a math game by adding counting, multiplication, or timed challenges.
Enhancements
- Add a timer.
- Add three lives.
- Add different fruits with different scores.
- Add sound effects when an apple is caught.
- Add a start screen and game-over screen.
- Increase the falling speed as the score increases.
- Add a high-score variable.
Conclusion
Catch the Apple is a simple and enjoyable way for Grade 3 students to begin learning game development in Code.org. By creating sprites, responding to keyboard input, using variables, repeating actions, and checking conditions, students learn important programming ideas without needing complicated code. The project also encourages creativity because students can change the characters, background, sounds, rules, and scoring system to design their own version of the game.
FAQs
What platform is used?
The game is created using Code.org Game Lab with block-based coding.
Who can build this catch the apple game?
It is designed as a beginner project for Grade 3 students with teacher guidance.
What is the main objective of catch the apple game?
The player moves the basket and catches as many falling apples as possible.
Which coding concepts are learned?
Students practice sprites, keyboard events, variables, loops, random positions, and if conditions.
Can the catch the apple game be improved?
Yes. Students can add timers, lives, sounds, levels, different fruits, and high scores.














