Create & Learn

Try Crab and Clownfish Race for fun Scratch Project!

Crab and Clownfish Race

Platform: Scratch
Level: beginner

In this project, the player clicks on the Crab to make it move forward a certain distance. If the Crab reaches a specific point on the screen, it plays a victory sound and changes to a happy costume. Meanwhile, the Clownfish swims towards the goal, and the player must help the Crab reach the finish line first by clicking repeatedly. If the Clownfish touches the Crab, a reminder sound plays, prompting the player to keep clicking.

Save to Account
See All Projects

Crab and Clownfish Race: Solution Outline

These are the high level steps to create this project. Try to create the project on your own first as much as possible, before checking the detailed solution samples below.

  1. Create the Crab and Clownfish sprites and set their starting positions.
  2. Program the Crab to move forward when clicked.
  3. Set up the victory condition for the Crab.
  4. Program the Clownfish to move automatically towards the Crab.
  5. Add a reminder sound if the Clownfish touches the Crab.

Crab and Clownfish Race Sample Solutions

This section provides detailed, step-by-step instructions on how to build the project. There are many ways to create a project, so feel free to explore different approaches. Please note that these instructions are Al-generated, so errors may occur and the coding blocks may not map to Scratch exactly. But it should serve as very valuable references. Stay attentive as you follow along, and enjoy!

Create the Crab and Clownfish sprites and set their starting positions.

First, choose or draw a Crab and a Clownfish sprite from the Scratch library. Place the Crab on the left side of the stage and the Clownfish on the right side, both at the starting line. This sets up the race environment.

Program the Crab to move forward when clicked.

Use the 'when this sprite clicked' block to make the Crab move forward. Attach a 'move 10 steps' block to this event. This will make the Crab move a little bit each time it is clicked.

Set up the victory condition for the Crab.

Add a condition to check if the Crab reaches a specific point on the screen (e.g., x position > 200). If it does, play a victory sound and switch to a happy costume using 'switch costume to'.

Program the Clownfish to move automatically towards the Crab.

Use a 'forever' loop to make the Clownfish move towards the Crab continuously. Use 'point towards Crab' and 'move 2 steps' blocks to make it swim towards the Crab.

Add a reminder sound if the Clownfish touches the Crab.

Use an 'if touching' block to check if the Clownfish touches the Crab. If it does, play a reminder sound to alert the player to keep clicking the Crab.

Common Potential Issues in Crab and Clownfish Race Project

It is common to have bugs in the code. Here are some of issues you might run into.

  • Ensure the Crab's movement is smooth and doesn't skip over the victory point due to large step sizes.
  • Make sure the Clownfish's speed is balanced so that it provides a challenge but is not impossible to beat.
  • Check that the reminder sound plays only once when the Clownfish touches the Crab, not repeatedly.

Extra Challenges For Crab and Clownfish Race

  • Add a timer to see how fast the player can make the Crab reach the finish line.
  • Create a new level where the Crab has to avoid obstacles while racing.

Learn Scratch Coding Skills

Enroll your child in award-winning online Scratch coding classes led live by experts and designed by professionals from Google, Stanford, and MIT.

Scratch Junior
Scratch Junior
Grades K-2
Start coding with ScratchJr, and make interactive stories and games
Learn More
Scratch Ninja
Free Intro
Scratch Ninja
Grades 2-6
Code games and animations with Scratch coding, beginner to advanced levels
Accelerated Scratch
Free Intro
Accelerated Scratch
Grades 5-9
Fast-paced introduction to Scratch coding: build games, stories, and animations
Intermediate Game Building with Scratch
Intermediate Game Building with Scratch
Grades 3-6
Code a new fun Scratch game every week

Explore More Fun Scratch Practice

The challenge continues: Enjoy even more Scratch tutorials dreamed up by other students or use your imagination to make your own!

backgroundTry The Tutorial
Develop My Own Idea

Find Best Classes For Your Child

Explore your child's grade level to find computer science classes and learning pathways that set your student up for success.