How to Make an Iron Man Catch Game in ScratchJr

Introduction

Start your journey to become a code superhero! In this exciting ScratchJr tutorial, your child will learn how to build an ‘Iron Man’ themed catching game. This project involves creating a custom Iron Man character, designing colourful Infinity Stones, and coding simple controls for movement. We’ll be using powerful blocks like Start on Message and the Wait block to make the stone objects fall at different times, adding a great challenge to the gameplay. By the end, they will have mastered key programming concepts like sending and receiving messages and scene changes, resulting in a fantastic, fully-playable ScratchJr project. This is a brilliant way to practise sequencing and algorithmic thinking in a fun, creative setting.

The Video Embed

What You Need

To create your Iron Man catch game in ScratchJr, you will need to set up the following characters and resources:

  • Characters:
    • Iron Man: (The tutorial uses a standard ScratchJr Cat character adapted using the Paint Editor to recolour it in red and yellow [00:21]).
    • Infinity Stones: Create a custom ‘blob’ character and duplicate it five or six times, colouring each one in a different colour to represent the various stones [00:52].
    • Joypad Buttons: Create three new square characters: Orange, Red, and Yellow, to act as your game controls [01:03].
  • Backgrounds:
    • A suitable background for the catch game (e.g., Space or a City setting).
    • A final ‘victory’ background for the scene that Iron Man jumps to after collecting all the stones [02:20].
  • Specific Setup:
    • Ensure all Infinity Stone characters are placed near the top of the screen to begin their falling animation.
    • Place the three Joypad Buttons in the bottom corner for easy access.

Step-by-Step Instructions

Step 1: Coding the Joypad Buttons (Sending Messages)

The buttons are your control mechanism. We will code each one to send a unique message when pressed.

  • Select the Orange button.
  • Add the Start on Tap block (yellow Flow category).
  • Connect it to the Send Orange Message block (also in the yellow Flow category).
  • Repeat this process for the Red button, connecting Start on Tap to the Send Red Message block.
  • Repeat this for the Yellow button, connecting Start on Tap to the Send Yellow Message block.
  • [Insert screenshot of Joypad code here, showing all three buttons’ scripts]

Step 2: Coding Iron Man’s Movement (Receiving Messages)

Iron Man needs to listen for the messages sent by the control buttons and perform the corresponding action.

  • Select the Iron Man character.
  • Start the code with Start on Green Flag to ensure the character is ready to play.
  • For the left movement, add the Start on Orange Message block and connect it to the Move Left block [01:12].
  • For the right movement, add the Start on Red Message block and connect it to the Move Right block.
  • For the jump, add the Start on Yellow Message block and connect it to the Jump block.
  • [Insert screenshot of Iron Man movement code here]

Step 3: Coding the Infinity Stones to Fall and Rotate

We want the stones to fall, bounce, and rotate to make them look realistic and engaging [01:33].

  • Select the first Infinity Stone character.
  • Use the Start on Green Flag block.
  • Add a Wait block (orange Control category) to set the timing for when the stone begins to fall. This is key: use a different wait time for each stone so they fall at different intervals [01:55].
  • Follow the Wait block with a series of Move Down blocks (e.g., set to ‘8’ or ‘9’ to reach the bottom).
  • Connect the Move Down block to the Bounce block (blue Motion category).
  • Simultaneous Code: Start a second script using another Start on Green Flag connected to a Repeat Forever block and a Rotate Clockwise block (set to ‘1’) to make the stone spin continuously [01:38].
  • [Insert screenshot of an Infinity Stone’s falling and rotating code here]

Step 4: Making the Stones Disappear and Triggering the Victory

When Iron Man catches a stone, it must disappear. The last stone collected must trigger the victory scene.

  • For all Infinity Stone characters, add the Start on Bump block (yellow Flow category).
  • Connect this to the Hide block (purple Looks category) [01:45].
  • For the last Infinity Stone Iron Man is expected to collect, add one extra block to this sequence.
  • After the Hide block, connect the Go to Page block (orange End category) and set it to the scene you created for the victory screen [02:13].
  • [Insert screenshot of the final stone’s collection code here]

Troubleshooting/Tips

  • Hiding and Showing Characters: If a stone disappears but doesn’t reappear when you restart the game, go back to Step 3. Ensure you have added the Show block (purple Looks category) immediately after the Start on Green Flagfor all your Infinity Stone characters.
  • Custom Wait Times: If all your Infinity Stones are falling simultaneously, check the value in the Wait blocks in Step 3. You must ensure each stone has a unique delay time to make the game challenging [02:07].
  • The Final Scene: If your game finishes but doesn’t change scenes, verify that only one stone has the Go to Pageblock attached to its Start on Bump script (Step 4), and that this stone is the last one you expect to be collected.

If you are interested in doing more coding with your children and pupils, please check out the other ScratchJr tutorials I have created.