Small projects you build with your teacher. Download the starter, then in Godot's Project
Manager click Import and pick the zip. Every TODO in the code is
a step you will write together.
Right-click: click with two fingers on the touchpad, or hold Alt and click.
Move around the 2D view: hold Space and drag.
Scroll with two fingers to zoom.
Erase tiles: in the TileMap tab, click the Eraser tool (or press E), then click or drag over the tiles.
Delete a node or a file: press Alt + Backspace. That is the Chromebook's Delete key.
Play and stop: click ▶ (Run Project) at the top right to
play, and the ■ button beside it to stop. Run Current Scene, the button
with a clapperboard, plays only the scene you have open.
Top-Down Movement
Make a player from nothing and write every line of how it moves, with an expert walking you through it inside Godot. You end with the one line Godot's own template uses, and know what it does.
When you need it
Input.is_action_pressed()Check if a key is held down right now.
velocityWhich way a body is going and how fast, in pixels per second.
move_and_slide()Move a body by its velocity, sliding along walls instead of going through.
normalized()Make a direction 1 long, so diagonals are not faster.
Input.get_vector()Read four keys into a direction in one line.
A Mario-style level where falling in a pit sends you back to the last flag you touched, and the door at the end loads level 2. In the browser editor, an expert walks you through it. The Starter download has a TODO for each step instead, to practice on your own.
When you need it
global_positionA node's spot in the level. Store it to come back to it later.
body_enteredAn Area2D noticing something walk into it: a coin, a checkpoint, a goal.
is_in_group()Check that the body that walked in is the player.
@export_fileA file picked in the Inspector, like which level comes next.
change_scene_to_file()Swap the whole level for another scene.
Paint a platformer level with tiles and make the tiles solid, so the player can run and jump on them with Godot's own movement script. An expert walks you through it inside Godot.
When you need it
TileMapLayerA grid you paint tiles onto: the ground, walls and platforms of a level.
TileSetThe tiles you can paint with, cut out of one picture. Collision is set here, once per tile.
is_on_floor()Only jump, or only stop falling, when standing on something.
Drop stones with the mouse. Left click puts a stone in the level, right click puts one on the player, and only one kind stays where you dropped it. An expert walks you through it inside Godot.
When you need it
preload()Load a scene once, so you can make copies of it later.
instantiate()Make a new copy: a bullet, an enemy, a coin.
add_child()Put the copy in the game. Until you do, nobody can see it.
get_parent()Reach the node above this one. A bullet goes in the level, not inside the player who fired it.
Shoot crates, balloons and a wall, with an expert walking you through it inside Godot. Every hit shows which signal ran, and only the things in the target group break.
When you need it
.connect()Run your function when something happens: a hit, a timer running out, a button pressed.
body_enteredSomething solid touched this area: a wall, a crate, the player.
area_enteredAnother area touched this one: a balloon, a pickup, a hitbox.
is_in_group()Ask what kind of thing you hit before doing anything to it.
queue_free()Remove something from the game for good: a grabbed coin, a spent bullet, a beaten enemy.
Coins that announce themselves, and two things that listen: a score in the corner, and a message when every coin is collected. You make the signal file yourself.
When you need it
signalDeclare news other scripts can hear: a coin collected, an enemy defeated, a door opened.
GameEventsOne shared file of signals, registered as an autoload, so any script can send or hear them.
emit()Send the news. The sender does not know or care who is listening.
connect()Listen for the news. Two scripts can listen to the same signal.
get_nodes_in_group()Count or find everything in a group, like every coin in the level.
show() and hide()Make a node appear or disappear without removing it.
Spikes that send ONE signal when they hurt you, and four things that hear it: a counter in the corner, a camera shake, a red flash on the player, and a sound. You make the signal file yourself. An expert walks you through it inside Godot.
When you need it
GameEventsOne shared file of signals, registered as an autoload, so any script can send or hear them.
emit()One event, sent once. The spikes do not know who is listening, or how many.
connect()Every script that cares listens for itself. Adding a fifth reaction changes nothing in the spikes.
create_tween()Change a value smoothly over time: fade a color back, slide a menu in, grow a pickup.
AudioStreamPlayerA node that plays a sound. Put the sound file in its Stream, then call play().
Coins drop in random spots and colors. Grab them before they vanish. When every coin is gone, a bigger wave drops. An expert walks you through it inside Godot.
When you need it
randi_range()A random whole number between two numbers: how many enemies, how much damage.
randf_range()A random decimal between two numbers: a spawn spot, a wait time. Godot 3 called it rand_range().
randi() % size()Pick one thing from a list at random: a color, a sound, an enemy type.
size()How many things are in a list. Add one more and every line using size() keeps working.
tree_exitingHear when something leaves the game, however it left. Count enemies left, then start the next wave.
The Main Menu comes ready to use; this one builds the pause menu. Esc in the game freezes it and shows Resume, Options and Main Menu, so stepping away never starts the game over.
When you need it
change_scene_to_file()SWAP screens and throw the old one away: menu to game, game back to the menu.
instantiate()Put a screen ON TOP and keep the one underneath: options over a paused game.
get_tree().pausedFreeze the whole game: a pause menu, a dialog box, a "Level complete!" screen.
process_modeChoose what still runs while the game is paused: the pause menu, the music.
queue_free()Close a screen you put on top. Whatever was underneath is still there.
set_input_as_handled()Use a key press up, so nothing underneath reacts to the same press.
ConfirmationDialogAsk "are you sure?" before something you cannot undo: quitting, deleting a save.
linear_to_db()Turn a slider's 0 to 1 into decibels, the unit a volume is set in.