Saturday, May 3, 2025

Scratch Tutorial for Kids: Create Your First Game! 🎮✨

 

Scratch Tutorial for Kids: Create Your First Game! 🎮✨

Welcome to Scratch, a fun way to learn coding by creating games, animations, and stories! In this tutorial, we’ll make a simple cat chasing mouse game. Let’s get started!


1. What is Scratch?

Scratch is a block-based coding platform where you drag and drop code blocks to make things happen. No typing required!
👉 Visit scratch.mit.edu and click "Create" to start.

Scratch Interface


2. Meet the Sprites!

  • Sprite = A character or object (like the cat 🐱 or mouse 🐭).

  • Stage = The background where your game happens.

Delete the Cat (We’ll Add Our Own!)

  1. Right-click the cat sprite and click "Delete".

  2. Click "Choose a Sprite" (bottom-right) and pick:

    • mouse (for the player).

    • cat (for the enemy).


3. Make the Mouse Move with Arrow Keys

We want the mouse to run away when we press arrow keys!

Step 1: Add Movement Code

  1. Click on the mouse sprite.

  2. Drag these blocks into the coding area:

scratch
Copy
Download
when green flag clicked
forever
  if key (right arrow v) pressed then
    change x by (10)
  end
  if key (left arrow v) pressed then
    change x by (-10)
  end
  if key (up arrow v) pressed then
    change y by (10)
  end
  if key (down arrow v) pressed then
    change y by (-10)
  end
end

💡 Try it! Press the green flag and use arrow keys to move the mouse.


4. Make the Cat Chase the Mouse

Now, let’s make the cat follow the mouse automatically.

Step 1: Add Chase Code

  1. Click on the cat sprite.

  2. Drag these blocks:

scratch
Copy
Download
when green flag clicked
forever
  point towards (mouse v)
  move (5) steps
end

🐱 The cat now chases the mouse!


5. Add a "Game Over" if Caught

If the cat touches the mouse, we’ll say "Game Over!".

Step 1: Detect Touching

On the cat sprite, add:

scratch
Copy
Download
when green flag clicked
forever
  if touching (mouse v) then
    say (Game Over!) for (2) seconds
    stop [all v]
  end
end

🎮 Now the game ends if the cat catches the mouse!


6. Add a Fun Background

  1. Click the Stage (bottom-left).

  2. Click "Choose a Backdrop" and pick "Maze" (or any fun background).


7. Bonus: Add a Score!

Let’s count how long the mouse survives.

Step 1: Create a Score Variable

  1. Click "Variables" > "Make a Variable".

  2. Name it "Score" and click OK.

Step 2: Update the Score

On the mouse sprite, add:

scratch
Copy
Download
when green flag clicked
set [Score v] to (0)
forever
  wait (1) seconds
  change [Score v] by (1)
end

🏆 Now the score increases every second!


8. Play & Share Your Game!

  • Click the green flag to start.

  • Press the arrow keys to move the mouse.

  • Try to avoid the cat and get a high score!

Share with Friends!

  1. Click "Share" (top-right).

  2. Add a title like "Cat & Mouse Chase!".

  3. Click "Share to Studio" so friends can play!


What’s Next?

🚀 Try These Fun Upgrades:

  • Add more enemies (dragons, zombies!).

  • Make the cat move faster over time.

  • Add sound effects (meow, squeak!).

No comments:

Post a Comment