3
Most read
11
Most read
13
Most read
Making a Racing Game
in Scratch
By Douglas Mawrey
Getting Started
Log in to Scratch, then go into your projects and
create a new project. Name it something along the
lines of “Racing Game” so you and other people know
what it is.
Making a Racetrack
Click the “Paint new backdrop” button in the bottom left of the screen to open a
window where you can draw a racetrack. While drawing, make sure you are
always in “Vector Mode”, otherwise, click “Convert to Vector” Keep one main
color as the color of the racetrack, we will use this color to check what the car is
touching later on.
Making a Car
Next, right click on the cat and click delete. Click on the “Paint new sprite”
button and draw a racecar. Make sure the car isn’t too small to see well or
too big to fit on the track and make it face right. Once you are done drawing,
click the “Set costume center” button at the top right of the screen and make
sure the black + lines up with the center of your sprite.
Making the Car Move
To make the car move, we need to drag some blocks to
make some code. In the scripts tab of your car, use the
blocks on the left of the screen to make this piece of code.
Each colored piece can be found in the different colored
sections on the left. To change “key ‘space’ pressed?” to
up arrow, click on the black arrow next to the name of the
key to choose the key you want.
Making the Car Move
Right click on the top of the group of code and click
duplicate. Then, attach the new group of code to the
bottom of the first group. Change “up arrow” to “down
arrow” and turn right to turn left.
Making the Car Move
To finally let the car move, make a new piece of code with a start block and a
forever loop. Next, drag the code you put together before into the forever loop.
Now, hit play and use the arrow keys to drive the car.
+ =
Variables
Variables store information that we can use throughout the
game. For this game, we are going to use a variable
named speed to change the speed of the car.
Using Speed
We want the car to slow down when it is driving off-road. To do this, we are
going to make a new script that sets the normal speed when the game starts.
The script then checks if the car is touching the road using if/else and a color
sensor, and if it is not, changes the speed to the lower number. We also need
to add speed into the movement code where 10 and -10 used to be, and
multiply speed by -1 to make the car move backwards for down
arrow.
Laps
Draw a new sprite that can serve as a start line for your race. Make it just wide
enough to cover the track left to right. Duplicate the sprite, and put the copy on
the other side of the track. If you like, you can make the start line look different
from the midpoint line by coloring it differently.
Laps
To make the laps work, we need to add 3 pieces of code to the two different lap
parts. We need a new variable and to use broadcasts which send messages to
the other sprites.
Starting the Game
Drag the player just behind - but not touching the start line.
After this, if you drag in the block, it will have
the x and y of the car filled in automatically. We put this
extra piece of code on the player in order to make it start at
the start line at the beginning of each game.
Timed Games
To add a timed option to the race, add this code to the stage. This code asks
the amount of time you want to race for, and if you enter “forever” or “Forever”,
it doesn’t time you. The driving script on the car must also be changed,
replacing the When Green Flag Clicked with When I Receive “Start”.
Boosts
In order to add a boost
power up, a new sprite must
first be drawn. These two
scripts will then need to be
added to the new sprite in
order to make the boost
spawn, stay for 3 seconds,
and disappear. The Boost
variable must also be made.
Boosts
Some code on the player must also be changed in order to make the boost
work. The code on the left must be changed to look like the code on the right
allowing the player to activate the boost by pressing space.

More Related Content

PPTX
Backward counting 20 to 0
PDF
Who Moved My Cheese
PDF
Illustrator clase teorica
PPT
Number bonds
PPT
Who moved my cheese
PDF
The Little Seed by Shannon Lee Archary
PPTX
Scratch: Programming for everyone
PPTX
04 Car race track game
Backward counting 20 to 0
Who Moved My Cheese
Illustrator clase teorica
Number bonds
Who moved my cheese
The Little Seed by Shannon Lee Archary
Scratch: Programming for everyone
04 Car race track game

Similar to Scratch Programming Racing Game Tutorial (20)

DOCX
Scratch for kids syllabus for 5 hours by bibek pandit
PPTX
Production reflection - video game project
PPTX
Production reflection
PPTX
Coding scratch
PDF
How do I learn to code with Scratch in AEP
PPTX
Scratch Lesson 6
PPTX
Scratch programming
PPTX
Coding scratch
PPTX
6. production reflection (lf) Interactive
PDF
2013-48. Game Progamming
PPTX
Diary entry
PPTX
Scratch Lesson 1
PPTX
Coding scratch n
PPTX
Basics of Programming using Scratch Platform
PPTX
Car racing game for android
PPT
Introduction to Scratch Programming
PPTX
7.Advanced Scripts in Scratch.pptx
PPTX
6. production reflection(2)
PPTX
Pong on SCRATCH Directions
PDF
BGC2011Scratch-Rev1.pdf
Scratch for kids syllabus for 5 hours by bibek pandit
Production reflection - video game project
Production reflection
Coding scratch
How do I learn to code with Scratch in AEP
Scratch Lesson 6
Scratch programming
Coding scratch
6. production reflection (lf) Interactive
2013-48. Game Progamming
Diary entry
Scratch Lesson 1
Coding scratch n
Basics of Programming using Scratch Platform
Car racing game for android
Introduction to Scratch Programming
7.Advanced Scripts in Scratch.pptx
6. production reflection(2)
Pong on SCRATCH Directions
BGC2011Scratch-Rev1.pdf
Ad

Recently uploaded (20)

PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PPTX
GSA Content Generator Crack (2025 Latest)
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
AI Guide for Business Growth - Arna Softech
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Types of Token_ From Utility to Security.pdf
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
Time Tracking Features That Teams and Organizations Actually Need
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Advanced SystemCare Ultimate Crack + Portable (2025)
CNN LeNet5 Architecture: Neural Networks
MCP Security Tutorial - Beginner to Advanced
How Tridens DevSecOps Ensures Compliance, Security, and Agility
GSA Content Generator Crack (2025 Latest)
Autodesk AutoCAD Crack Free Download 2025
AI Guide for Business Growth - Arna Softech
Computer Software and OS of computer science of grade 11.pptx
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Types of Token_ From Utility to Security.pdf
Weekly report ppt - harsh dattuprasad patel.pptx
Topaz Photo AI Crack New Download (Latest 2025)
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
Salesforce Agentforce AI Implementation.pdf
Patient Appointment Booking in Odoo with online payment
Visual explanation of Dijkstra's Algorithm using Python
Time Tracking Features That Teams and Organizations Actually Need
CCleaner 6.39.11548 Crack 2025 License Key
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Ad

Scratch Programming Racing Game Tutorial

  • 1. Making a Racing Game in Scratch By Douglas Mawrey
  • 2. Getting Started Log in to Scratch, then go into your projects and create a new project. Name it something along the lines of “Racing Game” so you and other people know what it is.
  • 3. Making a Racetrack Click the “Paint new backdrop” button in the bottom left of the screen to open a window where you can draw a racetrack. While drawing, make sure you are always in “Vector Mode”, otherwise, click “Convert to Vector” Keep one main color as the color of the racetrack, we will use this color to check what the car is touching later on.
  • 4. Making a Car Next, right click on the cat and click delete. Click on the “Paint new sprite” button and draw a racecar. Make sure the car isn’t too small to see well or too big to fit on the track and make it face right. Once you are done drawing, click the “Set costume center” button at the top right of the screen and make sure the black + lines up with the center of your sprite.
  • 5. Making the Car Move To make the car move, we need to drag some blocks to make some code. In the scripts tab of your car, use the blocks on the left of the screen to make this piece of code. Each colored piece can be found in the different colored sections on the left. To change “key ‘space’ pressed?” to up arrow, click on the black arrow next to the name of the key to choose the key you want.
  • 6. Making the Car Move Right click on the top of the group of code and click duplicate. Then, attach the new group of code to the bottom of the first group. Change “up arrow” to “down arrow” and turn right to turn left.
  • 7. Making the Car Move To finally let the car move, make a new piece of code with a start block and a forever loop. Next, drag the code you put together before into the forever loop. Now, hit play and use the arrow keys to drive the car. + =
  • 8. Variables Variables store information that we can use throughout the game. For this game, we are going to use a variable named speed to change the speed of the car.
  • 9. Using Speed We want the car to slow down when it is driving off-road. To do this, we are going to make a new script that sets the normal speed when the game starts. The script then checks if the car is touching the road using if/else and a color sensor, and if it is not, changes the speed to the lower number. We also need to add speed into the movement code where 10 and -10 used to be, and multiply speed by -1 to make the car move backwards for down arrow.
  • 10. Laps Draw a new sprite that can serve as a start line for your race. Make it just wide enough to cover the track left to right. Duplicate the sprite, and put the copy on the other side of the track. If you like, you can make the start line look different from the midpoint line by coloring it differently.
  • 11. Laps To make the laps work, we need to add 3 pieces of code to the two different lap parts. We need a new variable and to use broadcasts which send messages to the other sprites.
  • 12. Starting the Game Drag the player just behind - but not touching the start line. After this, if you drag in the block, it will have the x and y of the car filled in automatically. We put this extra piece of code on the player in order to make it start at the start line at the beginning of each game.
  • 13. Timed Games To add a timed option to the race, add this code to the stage. This code asks the amount of time you want to race for, and if you enter “forever” or “Forever”, it doesn’t time you. The driving script on the car must also be changed, replacing the When Green Flag Clicked with When I Receive “Start”.
  • 14. Boosts In order to add a boost power up, a new sprite must first be drawn. These two scripts will then need to be added to the new sprite in order to make the boost spawn, stay for 3 seconds, and disappear. The Boost variable must also be made.
  • 15. Boosts Some code on the player must also be changed in order to make the boost work. The code on the left must be changed to look like the code on the right allowing the player to activate the boost by pressing space.