Create & Learn
Background

Try City Transport Race for fun Scratch Project!

City Transport Race

Platform: Scratch
Level: advanced

In this project, students will create a racing game where the Car, Ship, and Train compete to finish first while navigating through a city. Each vehicle will have custom blocks for their unique movement mechanics and must follow different routes with specific coordinates. Students will use a list to keep track of each vehicle's speed and distance covered, updating it with a timer to see who can reach the finish line the fastest.

Save to Account
See All Projects

Backdrop And Sprite Images For The Project

background
background
1024 x 1024
Car
Car
1024 x 1024
Ship
Ship
1024 x 1024
Train
Train
1024 x 1024

City Transport 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. Set up the stage and sprites.
  2. Create custom blocks for movement.
  3. Set up lists to track speed and distance.
  4. Implement a timer to track the race duration.
  5. Determine the winner and display results.

City Transport 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!

1. Set up the stage and sprites.

Create a city-themed backdrop for the race. Add three sprites: Car, Ship, and Train. Position them at the starting line. Ensure each sprite has a clear path to follow on the stage.

2. Create custom blocks for movement.

For each sprite, create a custom block to define its unique movement mechanics. For example, the Car might move in a straight line, the Ship might move diagonally, and the Train might follow a track. Use the 'define' block to create these custom movements.

3. Set up lists to track speed and distance.

Create lists to keep track of each vehicle's speed and distance covered. Initialize these lists with starting values. Update the lists as the vehicles move across the stage.

4. Implement a timer to track the race duration.

Use the timer block to keep track of how long the race takes. Display the timer on the stage. Update the vehicle positions based on their speed and the elapsed time.

5. Determine the winner and display results.

At the end of the race, compare the distances covered by each vehicle to determine the winner. Display the results on the stage, showing which vehicle finished first, second, and third.

Common Potential Issues in City Transport Race Project

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

  • Ensuring that the custom movement blocks are correctly defined so that each vehicle moves as intended.
  • Keeping the lists updated accurately with each vehicle's speed and distance covered.
  • Making sure the timer is reset and functions correctly to track the race duration.

Extra Challenges For City Transport Race

  • Add obstacles on the track that vehicles must avoid, requiring them to change their paths.
  • Introduce power-ups that temporarily increase a vehicle's speed when collected.

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 beginner-friendly Scratch coding
Accelerated Scratch
Free Intro
Accelerated Scratch
Grades 5-9
Fast-paced introduction to 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.