How to Make a Dodging Game in Scratch

How to Make a Dodging Game in Scratch

This tutorial will teach you how to make a simple dodging game in Scratch, where a player avoids flying ducks and collects silver ducks to earn points.

This project is highly recommended for intermediate Scratchers, and teaches the concepts of clones, messages and smooth movement. If you’re already a Scratch pro, you can still grab cool ideas for effects, clone logic, and collision handling.

What You’ll Learn

  • How to move a character smoothly using the mouse
  • How to use cloning to create falling obstacles
  • How to create a score system and collectibles
  • How to make a simple Game Over screen
  • A cool trick to add fading visual effects
  • And best of all: how to make the game actually fun!

Meet the Player: Grandpa Sprite

The main character is a cute pixel-art Grandpa. He’ll follow the mouse smoothly using a smart bit of math: Smooth Movement

This creates smooth motion that feels natural and responsive.

We also make sure he only rotates left and right with this simple block: Set Rotation Style


Ducks, Coins, and Clones

The challenge? Ducks falling from the sky! Some are just regular ducks, but the rare silver one is a collectible coin.

Here’s how it works:

  • The duck sprite has 3 costumes: left-facing duck, right-facing duck, and a ilver duck (coin).
  • A loop creates clones every 0.35 seconds.
  • Each clone is randomly assigned a costume.
  • Ducks fall down until they hit the ground.
  • If they touch the player? 🟥 Game over.
  • But if it’s the silver duck and you catch it? 🟨 Score +1!

This part uses these blocks of Scratch:

Create Clone Of Myself and When I Start as a clone

Essential blocks for making any sort of repeated, randomized spawns in Scratch.


Effects, Collisions, and Game Over Logic

When ducks hit the ground, they fade out with visual effects, a great final touch that adds polish:

repeat 10
  change size by 5
  change ghost effect by 10
  change brightness by 10

If a regular duck touches the player, the game ends with a broadcast:

broadcast [game over v]
stop [all v]

But silver ducks? They’re safe! Just a nice bonus that increases the score.

You’ll even learn to fix a common bug where silver ducks incorrectly trigger game over, using:

if <costume number = 1 or costume number = 2> then
  broadcast [game over v]

Ready to Build It Step by Step?

The best part of this project is watching it come to life on screen, in just a few minutes!

Click here to watch the full video tutorial on YouTube


Remix It!

Once you’ve learned the basics of this game, it becomes a great starting point for customizing and making it your own.

  • Want to change the duck sprite? Go for it.
  • Prefer a cat dodging raindrops? Just change the costumes.
  • Want sound effects, lives, levels? All possible, the core mechanics are in place.

Finished This Tutorial?

Subscribe to our YouTube channel for more Scratch projects and tutorials, that help explore programming in creative and effective ways. New tutorials are posted regularly!

Happy Coding!
TheSTEAMIst
The STEAMistt Avatar
Last updated on