Table of Contents

Build a Catch the Apple Falling-Object Game Using PictoBlox Junior Blocks

Example Description
Learn how to create a fully playable falling-object game in PictoBlox Junior Blocks where Tobi catches falling apples using arrow key controls with collision detection, background music, and a Game Over scene with a Play Again button.

Introduction

In this project, we are going to create a Catching the apple game in PictoBlox Junior Blocks! The aim of the game is to help Tobi catch the falling apples before they hit the ground.

We are going to use Motion blocks to make the apple fall from the sky and Events to move Tobi back and forth. You’ll need quick reflexes, because if Tobi misses an apple and it touches the floor, the game is over!

Let’s begin!

Setting Up the Game Scenes

Scene 1 – Gameplay Scene

  1. Create the first scene; click the backdrop to add the desert backdrop.
  2. You already have Tobi; add the Apple sprite in the sprite library. Click the choose a sprite> use the search to find the Apple > select the Apple.

    Scene 2 — Game Over Scene

  3. Now you need to add Scene 2; click the backdrop to add the Blue Sky 2 backdrop.
  4. Add the Button sprite in the sprite library. Click the ‘choose a sprite’ > use the search to find the apple > select the apple.
  5. Add the ‘Game Over’ text in the backdrop.
  6. Add the Apple sprite in the sprite library. Click the brush icon above the apple sprite to customise your broken apple, like the image.
  7. Remove the Tobi sprite from Scene 2.

Coding Tobi – Player Controls

Scene 1: Tobi sprite 

  1. Add the ‘start on key pressed’ block from the Control palette.
  2. Change the Left arrow from the dropdown menu.
  3. Add the Forward block from the Motion palette.

Coding the Apple – Four Scripts

Scene 1: Apple sprite

Script A – Apple fall animation

  1. First the apple falls from top to bottom. Go to Events and drag the Green Flag block into your coding area.
  2. Add the ‘Move to position’ block from the Motion palette. Set the Start position at the top and the end position at the bottom as mentioned in the image below.
  3. From the Sound palette, add the play sound block. 
  4. From the Sound palette, click the Add sound (sound icon) to add the music to your project. 
  5. Search ‘Pop’ and ‘Game sound’ and select them for this project.
  6. Change the sound to ‘Pop’ in the dropdown.
  7. Add the Repeat forever block from the Control palette.
  8. Inside the repeat forever block,
  9. Add the Down block from the motion palette.
  10. Now, add background sound to the entire game.

Script B – Add background sound

  1. Go to Events and drag the Green Flag block into your coding area.
  2. From the Sound palette, add the play sound block and change the sound into video game 2

Script C – Tobi touching animation

  1. Add the ‘Start on touching object’ block from the events palette. Change Tobi in the dropdown.
  2. Add a ‘go to random position’ block from the motion palette. Change to ‘Top edge’ in the dropdown.
  3. Add the ‘Set instrument’ block from the Sound palette. Change the instrument to an electronic piano.
  4. Add the play note block from sound block, set the play note to E(4).

Script D – Move to next scene

  1. Add the ‘Start on touching object’ block from the events palette. Change the bottom edge in the dropdown.
  2. Add the ‘Change scene’ block from the controls palette. Make sure the next scene is Blue Sky 2.

Scene 2: Button sprite

  1. Add the start on sprite clicked block from the Control palette.
  2. Add the ‘Change scene’ block from the controls palette. Ensure that the next scene is the desert.

Output

Conclusion

In this project, we learned how to create a Catch the Apple game in PictoBlox Junior Blocks. We required a computer with PictoBlox installed and the sprite library to add the Apple and Button sprites. We used a move to position block to make the apple fall, a repeat forever loop to keep it falling, and touching object events to detect when Tobi catches the apple or when it reaches the ground. We also set up two scenes — a gameplay Desert scene and a Game Over Blue Sky 2 scene — with a Play Again button to restart. With this project, kids and learners will have a better understanding of game design, collision detection, scene switching, and how to use events and loops to build interactive games in PictoBlox.