Market Day London · Lesson 01 of 50 · Beginner · About 21 min
Briar Lane is a fictional London street market. Nia gets there before the crowds and opens the signs one by one.

Download the projects from the course page. In Godot’s Project Manager, choose Import, select project.godot, and use Run Project (F5). Start from the blank market project in checkpoints/start. Keep the checkpoint ZIP intact and make edits in an extracted working copy.


Build it step by step
Language and tools in this lesson Godot Project Manager, Control, extends, _ready(), Label, add_child(), print().
-
Make the project
Open Godot 4.7.2, choose Create, name the project Market Day London and choose Compatibility. Create a new empty project folder.
Why it works Compatibility is the rendering mode used by the course checkpoints. A project keeps the settings and files for one game in one place.
-
Choose the main screen
Choose User Interface in the Scene panel. Rename the root Market and save the scene as main.tscn. Leave the root Control selected.
extends ControlWhy it works Control gives the screen properties such as size, position and input while the project loads main.tscn as its first scene.
-
Attach the market script
Click Attach Script above the Scene tree. Set the path to res://main.gd and choose Create. Replace its contents with this checkpoint and save.
extends ControlWhy it works The script belongs to the selected node. The line starting with extends tells the editor which kind of Godot node it can control.
-
Find the label instructions
In _ready, follow the order of Label.new(), text, position, and add_child(). Point to the place where the market name becomes visible.
title.text = "Market Day London"Why it works _ready runs when the screen enters the scene. A label must be attached to the scene before Godot can draw it.
-
Choose the first scene
Press F5. If Godot asks for a main scene, choose Select Current. Check that you see the game name and the market-opening line.
board.text = "Briar Lane Market is open."Why it works F5 runs the full game from the chosen first scene. The board variable refers to a second label under the title.
-
Find the printed check
Stop with F8 and open the Output panel. Find the market message printed by the script.
print(board.text)Why it works Print sends a value to the editor. It is useful for checking which instructions ran even when the market screen is closed.
Watch the values change
-
Run the project. Godot creates the Market Control.
What you see. The window appears and runs _ready. -
Read the title area. The title Label receives the text Market Day London.
What you see. The large title appears at the top. -
Read Output. print receives the board Label’s current words.
What you see. Briar Lane Market is open. appears in Output.
Predict before you run What will print(board.text) show if you set board.text to Welcome to Briar Lane! just before it?
Reveal the answer
Output displays Welcome to Briar Lane!, because print reads the current value of the label.
Complete checkpoint
A market title and opening sign appear on the screen. Godot Output contains the opening line.
main.gd
extends Control
const NIGHT := Color("#0d2335")
const PANEL := Color("#17374b")
const CREAM := Color("#fff4da")
const MINT := Color("#9ce4ce")
const GOLD := Color("#ffd789")
var board: Label
func _ready() -> void:
var title := Label.new()
title.text = "Market Day London"
title.position = Vector2(42, 34)
title.add_theme_font_size_override("font_size", 34)
title.modulate = CREAM
add_child(title)
board = Label.new()
board.position = Vector2(45, 88)
board.add_theme_font_size_override("font_size", 22)
board.modulate = MINT
add_child(board)
board.text = "Briar Lane Market is open."
print(board.text)
func _draw() -> void:
draw_rect(Rect2(Vector2.ZERO, get_viewport_rect().size), NIGHT)
draw_rect(Rect2(32, 120, 431, 316), PANEL)
draw_rect(Rect2(487, 120, 437, 316), PANEL)
GDScript line by line
Follow the line numbers, including the indent at the start of each line. Find the code the game will run first, then look for the function that reacts when you tap or change something.
Read main.gd line by line
-
extends ControlAttach these screen-building instructions to a Godot Control. That gives the script positions, children and input events. -
const NIGHT := Color("#0d2335")Use this dark ink colour behind the market. The fixed colour is also used for lettering on the mint marker and brighter signs. -
const PANEL := Color("#17374b")Use one lighter shade to group the map and controls against the dark background. -
const CREAM := Color("#fff4da")Keep the title and labels light enough to read against dark panels. -
const MINT := Color("#9ce4ce")Use this accent to highlight the status label and Nia’s marker. -
const GOLD := Color("#ffd789")Mark utility labels and the collection point with a pale yellow that stands apart from the paving. -
var board: LabelSave the opening label so later methods can change it without needing to create a new one. -
func _ready() -> void:Godot calls this once when the Market scene is ready to create the title, notice and controls. -
var title := Label.new()Create an unattached Label for the permanent title. It becomes visible when it is added to the scene. -
title.text = "Market Day London"Put the game name into the title label. The title stays fixed while smaller words underneath change. -
title.position = Vector2(42, 34)Leave a margin of 42 pixels from the left and 34 from the top. -
title.add_theme_font_size_override("font_size", 34)Set this title to a larger local font size. The rest of the labels can keep different sizes. -
title.modulate = CREAMSet the title’s drawing colour to the pale cream chosen above. -
add_child(title)Add the title to the running scene so Godot draws and maintains it. -
board = Label.new()Create the changing notice label and store it in the field used by other methods. -
board.position = Vector2(45, 88)Position the variable status words underneath the game name. -
board.add_theme_font_size_override("font_size", 22)Set a smaller font for status messages, which can be longer than the title. -
board.modulate = MINTTint the notice mint so it stands out as the changing information. -
add_child(board)Attach the notice beneath the title so the player sees the current message. -
board.text = "Briar Lane Market is open."Give the notice its first message. The log command below reads this same text. -
print(board.text)Send the current notice to Godot’s Output panel. This is a record developers can inspect independently of the game screen. -
func _draw() -> void:Paint this section when Godot refreshes the Control. Draw the background first and the frontmost details last. -
draw_rect(Rect2(Vector2.ZERO, get_viewport_rect().size), NIGHT)Fill the visible window so there is a consistent dark background behind the game panels. -
draw_rect(Rect2(32, 120, 431, 316), PANEL)Draw the dark rectangle under the tile map. -
draw_rect(Rect2(487, 120, 437, 316), PANEL)Draw an adjacent rectangle behind the controls and basket information.
Find and fix a bug
If the script runs but the title is missing, check that add_child(title) is indented inside _ready and that the script is attached to Market.
Try a change
Ages 10–12 can write a different opening line. Ages 13–16 can change the font size and test how the label behaves when its text gets longer.