Project 30 of 35  ·  Scratch Programming  ·  Module 3
Module 3

Cats

Create an interactive cat character with responsive animations, needs and day/night behaviour.

🍓  Open on Raspberry Pi Projects  ↗ Opens the official Raspberry Pi Foundation project — includes starter files and full step-by-step guide

What You Will Build

Create an interactive cat character with responsive animations, needs and day/night behaviour. Follow the guide below to build the project, then open the official Raspberry Pi page for starter files, worked examples and extra help.

🍓 This project is on the Raspberry Pi Foundation website. Click the orange button above to access the full guide, starter Scratch project and extension activities on projects.raspberrypi.org.

What You Will Learn

  • Animate a cat walking across the stage by switching costumes in a loop
  • Switch backdrops to move between indoor and outdoor scenes
  • Add a food bowl that the cat can eat from
  • Track hunger and energy variables over time
  • Implement a sleep mode triggered by inactivity

Step-by-Step Guide

  • 1Add an outdoor and indoor backdrop.
  • 2Add a cat sprite with costumes: walk1, walk2, sitting, sleeping, happy.
  • 3On start: animate the cat walking right by switching walk1 and walk2 in a loop.
  • 4When cat reaches x:200: switch to indoor backdrop, move cat to x:-200.
  • 5Add a food bowl sprite. When cat touches bowl: play eating sound, switch to happy costume, increase hunger.
  • 6Add a yarn ball that rolls left. Cat chases it using point towards [yarn ball] then move 2 steps.
  • 7Add a pet button. When clicked: cat purrs (play sound), change size by 5, change size back after 0.5s.
  • 8Create a hunger variable that decreases every 5 seconds. When hunger < 3: cat meows.
  • 9After 30 seconds of no interaction: switch to sleeping costume and show ZZZ.
  • 10Add a day/night variable: swap to night backdrop after 60 seconds.

Extension Challenges

Finished the main project? Push further:

  • Add two cats with different personalities and speeds.
  • Add a vet mini-game that triggers when the cat gets sick from overeating.
  • Add a kitten that hatches from an egg at the start and grows over time.