Make your very own top-down racing game together from a blank screen to a working car you can drive! No coding experience needed. Every step is explained simply. 🚀
Godot is like a magical toybox where you can build your own video games! We'll use it to make a racing car that you can actually drive. How cool is that?!
Godot 4 is a free, open-source game engine. This workshop uses GDScript (Python-like). Download from godotengine.org it's about 40 MB and needs no installer.
Create a new Godot project called "My Racing Game" and open it up for the first time!
My Racing GameClick around the Godot editor for 60 seconds. Can you find the FileSystem tab at the bottom? That's where your game files live!
Create a new 2D scene, add a coloured background, and draw a simple race track using a TileMapLayer (or just a big colourful rectangle to start).
#444444).Create a car scene using a CharacterBody2D node with a coloured rectangle as the car body. We'll make it look like a proper top-down car!
Pick a colour for your car below — remember what you pick and set it in Godot!
✨ Great choice! Set your ColorRect's colour to #ff6b35 in Godot.
Write a GDScript that makes the car move with arrow keys (or WASD). By the end, you'll be able to press Play and drive!
func _physics_process must be indented! Press Tab at the start of those lines. Godot will usually do this for you automatically.This is like setting the car's top speed. Try changing 300 to 500 is it faster? What about 100?
How quickly the car turns. A bigger number = spinny! A smaller number = more like a truck.
Change speed to 600 and play again. Whoa! Now try 100. What feels best to you? Change it back to whatever feels fun!
Add a Camera2D to the car so the view follows it around the track!
Add a Label to the screen that shows how many seconds the player has been driving. It counts up like a stopwatch!
Time: 0.0$CanvasLayer/TimerLabel part is the path to your Label node like an address! Make sure your nodes are named exactly CanvasLayer and TimerLabel, otherwise it won't find them.delta is the time (in seconds) since the last frame. Adding it up gives us total elapsed time this is the standard game-loop pattern. snappedf rounds it to 1 decimal place so it doesn't scroll too fast.Press Play! Do you see a timer in the top left? Drive your car around and watch the seconds tick up! Can you do a lap in under 10 seconds?
Place a finish line on the track. When the car crosses it, the timer stops and a "You Win!" message appears!
🏁 YOU WIN!.body_entered signal fires whenever a physics body enters the Area2D. We connect it in _ready() to our _on_finish function. This is a core Godot pattern signals instead of polling!Play the game and drive to the finish line! Does the "YOU WIN!" message appear? What's your best time? Try to beat it!
Customise your game — change colours, add your name, adjust the speed, and share it with someone!
Change the car's colour in car.tscn. Change speed and turn_speed in car.gd. Can you make it feel just right?
Add more ColorRect rectangles to make a bigger track with corners! Make the grass a different shade. Add some obstacles!
Add a new Label to the CanvasLayer that says your name and "presents:" at the top. Every great game has the maker's name on it!
Add a Button node to the CanvasLayer. When clicked, call get_tree().reload_current_scene() to restart the race!
🛠️ Free In-House Dev Tools
Use these free browser tools alongside this workshop to create custom sprites, sounds, levels and colour schemes for your game. No installs. Free forever.