Midnight Deck Dash · Lesson 01 of 50 · Beginner · About 25 min
The Starlight Voyager is quiet after midnight. Courier Sol needs a working dispatch sign before the first luggage run.

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 cruise 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 scene, Control node, extends, func, _ready, Label.new(), add_child, print.
-
Make a blank project
Open Godot 4’s Project Manager. Select New Project, name it Midnight Deck Dash Practice and pick an empty folder. Choose Compatibility as the renderer and select Create & Edit.
Why it works A project folder keeps the scene, code and artwork together. Compatibility works well for a 2D practice game.
-
Create the screen scene
Choose User Interface under Create Root Node. Rename the new Control DeckOffice in the Scene tree. Press Ctrl+S or Cmd+S and save it as main.tscn.
Why it works A scene is a saved group of nodes. Control gives the starting node the behaviour of a user-interface element.
-
Attach the script
Select DeckOffice and click Attach Script above the Scene tree. Keep GDScript and set the path to res://main.gd. Replace any template code with the checkpoint script.
extends ControlWhy it works The script extends Control, so it can use the properties and methods of a Control. Res:// points inside the project folder.
-
Create the sign at the start
Type the _ready header and its first two indented lines. Quotes mark the exact sign text.
func _ready() -> void: var sign := Label.new() sign.text = "Midnight Deck Dash | Deck office"Why it works Godot calls _ready when the scene is ready. Label.new() creates the label in memory. Assigning sign.text tells that label what to say.
-
Put the sign on screen
Set its position and font size, then call add_child(sign). Read Vector2(40, 50) as 40 pixels across and 50 down from the top-left.
sign.position = Vector2(40, 50) sign.add_theme_font_size_override("font_size", 32) add_child(sign)Why it works The new label becomes a child of the scene root. Godot can now display it. The font size applies specifically to this label.
-
Look at both outputs
Run with F5. If Godot asks for a main scene, choose Select Current. Read the sign in the game. Open the editor’s Output panel to find the printed message.
print("Night shift ready.")Why it works The Label is for the player. print sends a message to the editor, which helps the developer check when a line ran.
Watch the values change
-
Run main.tscn DeckOffice becomes ready.
What you see. Godot starts _ready. -
Create the Label The new label has text and a position.
What you see. The label joins the scene tree. -
Reach print The scene has one child Label and a log message.
What you see. The sign appears and Output says Night shift ready.
Predict before you run If you remove add_child(sign), does the ready message disappear too?
Reveal the answer
The ready message still prints. The sign stays outside the scene tree and does not appear.
Complete checkpoint
The game displays a large dispatch-office label and the editor’s Output says Night shift ready.
main.gd
extends Control
func _ready() -> void:
var sign := Label.new()
sign.text = "Midnight Deck Dash | Deck office"
sign.position = Vector2(40, 50)
sign.add_theme_font_size_override("font_size", 32)
add_child(sign)
print("Night shift ready.")
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 ControlGives the root of this lesson the positioning and sizing features of a Godot Control, which is the type created by choosing User Interface in the scene editor. -
func _ready() -> void:Godot calls this method after the scene is ready. Its indented steps make the dispatch label and any controls before the player can use them. It does not return a value. -
var sign := Label.new()Creates a fresh Label node. The variable sign keeps a reference to it, and the colon-equals operator infers the variable’s type from Label.new(). -
sign.text = "Midnight Deck Dash | Deck office"Sets the dispatch sign’s visible words. The quotes delimit the string, and the bar within them is part of the sign. -
sign.position = Vector2(40, 50)Places the label 40 pixels from the left and 50 down from the top, relative to its parent. -
sign.add_theme_font_size_override("font_size", 32)Overrides just the label’s font_size theme setting for a large, readable dispatch sign. -
add_child(sign)Adds the Label to this node so it becomes part of the active scene and Godot can display its text. -
print("Night shift ready.")Writes a ready message to the editor’s Output panel. The player-facing sign does not change.
Find and fix a bug
If the sign is missing but the ready message prints, check that add_child(sign) is inside _ready and names the label you created.
Try a change
Write your own ship welcome. Keep the quotes. Explain which message the player sees and which message the developer sees.