How to Create a Catch an item Game using Scratch Programming

Hey there, fellow coders!

Ready to dive into the awesome world of Scratch? This visual programming language is perfect for kids and beginners alike. It’s like building with colorful blocks instead of typing lines of code – super fun and easy to learn!

Today, let’s create a cool game where you try to catch falling items. This project is a fantastic way to get started with Scratch. Even if you’re completely new to coding, you’ll be surprised at how quickly you can build something awesome.

So, whether you’re a curious kid, a teacher looking for engaging activities, or a parent wanting to introduce your child to coding, this tutorial is for you. Let’s get coding!

Let’s start creating our project on “Catch an item”

Step 1: Add sprites and Backdrops

Let’s Get Started!

The first thing we need to do is choose some awesome sprites and a cool backdrop.

Sprites: Think of them as the stars of your show! In Scratch, sprites are the characters that make your games and animations come to life.
Backdrops: These are the backgrounds for your project. A striking backdrop can really make your game pop!
For our “Catch the Fish” game, we’ll need:

A fish sprite: This is what we’ll be trying to catch.
A fishbowl sprite: This is our catching tool.
A sea backdrop: To set the scene for our underwater adventure.
Let’s dive in and get creating!

Various Backdrops used in the catch an item project.

Step 2:Let’s Code!

Imagine the fish raining down from the top of the screen! Our goal is to catch them with our fishbowl. Every time we catch a fish, we’ll score a point!

To make the game exciting, we’ll use a special block called “Go to” to send our fish to random spots on the screen. First, let’s make our fish move to a random spot at the top of the screen every time the game starts. To do that, we’ll use a ‘go to’ block to set the fish’s position. We’ll pick a random number between -212 and 212 for the x-axis (side to side), so the fish will fall from a surprise spot each time!

Now, let’s make the fish fall! We’ll use a block called “Change x by -5”. This makes the fish move to the left. But wait, we want the fish to fall down, right? To do that, we’ll use another block called “Change y” inside a special “Forever” block. This makes the fish keep falling and falling until it reaches the bottom of the screen.

Isn’t that cool? We’re making the fish move just like in a real game!”


Step 3: Moving the Fish Bowl

The main goal is to move the fishbowl left and right using the keyboard. To keep things simple, we’ll lock its movement to stay horizontally aligned at the same height. Here’s how you can do that:

  • Select the fishbowl sprite and write the following code:
    1. Use the “when [right arrow] key pressed” block to move the fishbowl to the right. Change the x position by 10.
    2. Use the “when [left arrow] key pressed” block to move the fishbowl to the left. Change the x position by -10.
    3. To keep the fishbowl from moving up and down, set its y position to -142.

Here’s how the code looks in Scratch:


Step 4: Scoring Points

Now, let’s add some excitement! The objective of the game is for the fish to “land” inside the fishbowl. Every time this happens, the player scores a point. Here’s how to set that up:

  1. Create a variable called “score”:
    • Go to the “Variables” category and click on Make a Variable. Name it score.
  2. Write the logic for scoring:
    • When the fish touches the fishbowl:
      • Increase the score by 1 using the “change [score] by 1” block.
      • Move the fish back to its initial position.
    • At the start of the game (when the green flag is clicked), set the score to 0 using the “set [score] to 0” block.

Here’s what the code looks like:

Step 5: Ending the Game

To make the game more challenging, we’ll end it when the fish touches the line at the bottom of the screen.

  • Use the “if <touching [line]> then” block.
  • Add the “stop all” block to halt the game.

Bringing It All Together

Now that you’ve added movement, scoring, and game-over logic, test your game. Run it by clicking the green flag. Use the arrow keys to move the fishbowl and try to catch the fish before it hits the line.

Test your Knowledge with these Quizzes !

Your time starts NOW!

DONE!


Motion Block Quiz in Scratch

This quiz will challenge your understanding of Motion blocks in Scratch Programming language

Grade : 1-8

Level : Intermediate Level

Please enter your Details

1 / 8

Which block would you use to change the sprite's position slightly to the left?

2 / 8

What information does the "Direction" reporter block provide?

3 / 8

How can you make a sprite face the mouse pointer?

4 / 8

How can you make a sprite smoothly move to a specific location?

5 / 8

If you want a sprite to always stay within the stage boundaries, which block is essential?

6 / 8

Which block is used to set the exact x-coordinate of a sprite?

7 / 8

Which block is used to make a sprite move forward?

8 / 8

What does the "If on Edge, Bounce" block do?

Your score is

The average score is 58%

0%

Try Our Scratch Programming Flash cards for Free!

Review Your Cart
0
Add Coupon Code
Subtotal

 
Scroll to Top