All Activities

Scratch: Code a Cat Eats Cake Game!

Scratch: Code a Cat Eats Cake Game!
Green highlight

Use Scratch to code a cat eats cake game where you program movement, controls, collision detection, scoring, and sound effects while testing gameplay.

Orange shooting star
Background blob
Challenge Image
Skill Badge
Table of contents

Step-by-step guide to code a Cat Eats Cake game in Scratch

What you need
Scratch account or access to scratch, speakers or headphones, optional colouring materials to design sprite costumes

Step 1

Open Scratch and click "Create" to start a new project.

Step 2

Select the Cat sprite or confirm the default Scratch Cat is selected.

Step 3

Add a Cake sprite from the Sprite Library or draw your own cake costume.

Step 4

Add movement controls to the Cat by scripting arrow key blocks so each key moves the Cat left right up or down.

Step 5

Click the Cat and add a "go to x y" block to set a clear starting position for the Cat.

Step 6

Click the Cake and add a "go to x: pick random -200 to 200 y: pick random -150 to 150" block to give the Cake a random starting spot.

Step 7

Make a variable named Score and add a "when green flag clicked set Score to 0" script.

Step 8

On the Cat add a forever script that says if touching Cake then broadcast "eatCake" and wait 0.5.

Step 9

Add a "when I receive eatCake" script on the Stage or Cat that changes Score by 1.

Step 10

On the Cake add a "when I receive eatCake" script that plays a chomping sound effect.

Step 11

On the Cake add a separate "when I receive eatCake" script that hides then waits 0.5 then goes to a new random position then shows.

Step 12

Click the green flag to test the game by moving the Cat to eat the Cake and fix any scripts if the score sound or respawn do not work.

Step 13

Share your finished Cat Eats Cake game on DIY.org.

Help!?

What can I use if I can't find the Cake sprite or the chomping sound?

If the Cake sprite or chomping sound is missing, choose another food sprite from the Sprite Library or draw/upload your own cake costume and record or pick a 'chomp' sound in the Sound tab to replace the built-in effect.

Why doesn't my Score increase when the Cat touches the Cake?

Check that the Cat's 'if touching Cake' block broadcasts exactly 'eatCake', that a 'when I receive eatCake' script on the Stage or Cat actually changes the variable named Score, and that you set Score to 0 with 'when green flag clicked' before testing.

How can I modify this game for younger or older kids?

For younger kids make the Cake larger, slow the Cat's arrow-key movement, and place the Cake at a fixed position instead of using 'pick random', while for older kids add a Timer variable, increase Cat speed, introduce multiple cakes with different points, or create levels that speed up respawns using the 'pick random' block and Score.

How can we extend or personalize the Cat Eats Cake game?

Add multiple cake costumes with different point values, animate the Cat by switching costumes when 'eatCake' broadcasts, change backgrounds for new levels, and store a high-score variable before sharing your finished game on DIY.org.

Watch videos on how to code a Cat Eats Cake game in Scratch

0:00/0:00

Here at SafeTube, we're on a mission to create a safer and more delightful internet. 😊

Lecture: 09 | MAKE CAT FLYING GAME IN SCRATCH | Game Development | Scratch Tutorial

4 Videos
Lecture: 09 | MAKE CAT FLYING GAME IN SCRATCH | Game Development | Scratch Tutorial

Lecture: 09 | MAKE CAT FLYING GAME IN SCRATCH | Game Development | Scratch Tutorial

Scratch Tutorial | Cat And Mouse Game | Scratch Easy Beginner Tutorial

Scratch Tutorial | Cat And Mouse Game | Scratch Easy Beginner Tutorial

Scratch Basics - A Beginners Guide to Scratch

Scratch Basics - A Beginners Guide to Scratch

Beginners Guide To Scratch (VERY Simple)

Beginners Guide To Scratch (VERY Simple)

Facts about block-based coding and game design

🐱 The Scratch Cat is the default mascot sprite — it's the first character many kids meet when they open Scratch!

🌍 Scratch is used by millions around the world and hosts millions of shared projects and remixes for learning and fun.

🧩 In Scratch, collision detection can be as simple as using an 'if touching' block to tell when the cat hits the cake.

🔊 Tiny sound effects like a 'munch' or 'ding' make gameplay feel more satisfying and give players important feedback.

🏁 Playtesting your game (trying it like a player) is how most bugs are found and how designers make scores and controls more fun.

How do I create a 'Cat Eats Cake' game in Scratch?

Start a new Scratch project, add or draw a cat and cake sprite, then program movement with "when key pressed" blocks to change x/y or point in direction and move. Use "if touching [Cake]" to detect collision, then change a Score variable, play a sound, and hide or reposition the cake. Add a "when green flag clicked" setup to reset score and positions. Test frequently, tweak speed and timing, and add sounds, animations, and levels.

What materials and tools do I need to code a Cat Eats Cake game in Scratch?

You'll need a computer or tablet with internet and access to the Scratch website or offline editor. A Scratch account is optional but useful for saving and sharing. Also use a keyboard and mouse or touchscreen, headphones for sounds, and the Scratch paint editor or image files for cat and cake sprites. A notepad for planning levels, and optional printable storyboard or parent supervision for younger kids are helpful.

What ages is the Scratch Cat Eats Cake game suitable for?

This activity suits beginners to intermediate kids, roughly ages 7–14. Younger children (5–7) can participate with adult help for typing and block explanation. Older kids (12+) can extend the game with variables, broadcasting, cloning, and level design. Tailor complexity: use simple arrow movement and collision for beginners, and add timers, high-score saving, or multiple enemies for advanced learners.

What are the benefits of making a Cat Eats Cake game in Scratch?

Making a Cat Eats Cake game teaches coding basics: sequencing, events, conditionals, collision detection, and variables. It builds problem-solving, debugging skills, creativity, and persistence. Kids practice math (coordinates, scoring) and sound design while gaining confidence sharing projects. For safety, encourage anonymous usernames, supervise online sharing, and avoid personal info. For variety, change themes, add timers, power-ups, or multiplayer with broadcasts.

Ready to create?

Drop Files here
Make

To create a safe space for kid creators worldwide!

Create

Vibe Coding

Kids GPT

All Tools

Kibu

Resources

Worksheets

SafeTube

Blog

FAQ

Account

Pricing

Log-in

Sign-up

Data Deletion

Company

About

Community Guidelines

Privacy Policy

Terms of Service

2025, URSOR LIMITED. All rights reserved. DIY is in no way affiliated with Minecraft™, Mojang, Microsoft, Roblox™ or YouTube. LEGO® is a trademark of the LEGO® Group which does not sponsor, endorse or authorize this website or event. Made with love in San Francisco.