Last time, we created a Node2D named Main and a Label for the title, then ran the game. This lesson picks up right where we left off. If you skipped those steps, do just the "Your first run" section of Lesson 1 first.
Nodes are building blocks
Godot games are built by combining building blocks called nodes. There are many kinds of nodes, and each one is good at one specific job.
| Node | What it does | Where we use it in this series |
|---|---|---|
Node2D | Has a 2D position, rotation, and scale. Often used as a "container" that groups other nodes | Holds the whole game together (Main) |
Sprite2D | Displays a single image | The character and the coins |
Label | Displays text | The title and the score |
CharacterBody2D | A body that moves and collides with walls and floors | The player in Lesson 4 |
Area2D | Detects when something overlaps it | Collecting coins in Lesson 6 |
Camera2D | Decides which part of the world is shown on screen | When we make the stage bigger in Lesson 5 |
A single node can't do much on its own, but by combining them you can make "a character that shows an image (Sprite2D), bumps into walls (CharacterBody2D), and picks up coins (Area2D)."
Scenes are groups of building blocks
When you arrange nodes into a tree and save it as a file, that's a scene. Scene files use the .tscn extension.
- The main game screen (
main.tscn) is a scene - A single coin (
coin.tscn) is also a scene - You can put one scene inside another as a building block (this is called instancing)
Once you've made a "coin" scene, you can place dozens of coins in a stage. And if you later want to change how the coin looks, you only fix coin.tscn in one place, and every coin updates. This is the core of how you build things in Godot.
Add a title (Label)
Let's tidy up the Label we made last time. Select Label in the Scene dock and set it up like this:
- Double-click it (or press F2) and rename it to
Title. Node names act as labels you'll use later to find nodes from a script. - In the Inspector, open Theme Overrides → Font Sizes, check Font Size, and set it to
32. - In the 2D view, drag
Titleto a spot a little in from the top left corner.
The rectangle outlined in blue in the 2D view is the area that's visible when the game runs. By default it's 1152 pixels wide and 648 pixels tall.
Add a character (Sprite2D)
For the character's image, we'll use icon.svg (the Godot logo), which comes with every new project. You can swap in your own art later.
- Select
Mainin the Scene dock and add aSprite2Dusing the "+" button. - Rename it to
Player. - Drag
icon.svgfrom the FileSystem dock into the Inspector's Texture field (the one that says "<empty>"). - In the Inspector, set Transform → Position to x = 576, y = 480.
Position uses coordinates where the top left of the screen is (0, 0): x increases to the right, and y increases downward. Watch out, because y points the opposite way from a math graph. 576 is exactly half of the 1152-pixel screen width, so the character appears near the bottom center of the screen.
You can also drag an image from the FileSystem dock straight into the 2D view, and Godot creates a Sprite2D that displays it. Once you're used to it, this is quicker.
Make the coin its own scene
Next up: the coin. Since we'll place lots of coins, we'll make it a separate scene from the start.
Get the coin image
Download the coin image coin.svg and put it in your project folder (where project.godot is). When you go back to Godot, it shows up in the FileSystem dock automatically.
Instead of downloading it, you can also paste the following into a text editor like Notepad and save it as coin.svg. SVG is an image format that describes shapes as text.
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
<circle cx="24" cy="24" r="21" fill="#f5b800" stroke="#a86b00" stroke-width="3"/>
<circle cx="24" cy="24" r="14" fill="none" stroke="#ffe066" stroke-width="3"/>
<rect x="21" y="14" width="6" height="20" rx="3" fill="#ffe066"/>
</svg>Create the coin scene
- From the menu, choose Scene → New Scene (Ctrl + N). A new tab appears at the top of the editor.
- In the Scene dock, click "Other Node", then select
Sprite2Dand create it. This becomes the scene's root node (the node at the very top). - Rename it to
Coin. - Drag
coin.svginto the Inspector's Texture field. - Press Ctrl + S and save it as
coin.tscn.
The coin sits in the top left corner of the screen (the origin) with half of it sticking out, but that's exactly right. In a building-block scene, you keep the block's own center at the origin and let the scene that uses it decide where to put it.
Place three coins (instancing)
Use the tabs at the top of the editor to go back to main, and let's place some coins.
- Drag
coin.tscnfrom the FileSystem dock ontoMainin the Scene dock.Coinis added as a child ofMain. - With
Coinstill selected, press Ctrl + D (Duplicate) twice. This createsCoin2andCoin3. - Set each one's Position as follows:
| Node | Position x | Position y |
|---|---|---|
| Coin | 300 | 360 |
| Coin2 | 576 | 300 |
| Coin3 | 852 | 360 |
Click the clapperboard icon (like the one used on film sets) next to the Coin nodes in the Scene dock to open the original coin.tscn. Instead of dragging, you can also add a coin with the chain link icon (Instantiate Child Scene) at the top of the Scene dock and pick coin.tscn.
Save with Ctrl + S and run it with F5.
Open coin.tscn, set Coin's Transform → Scale to (2, 2), save, and go back to main. All three coins are bigger now. Once you've checked, set it back to (1, 1).
Parent-child relationships and coordinates
In the Scene dock's tree, nodes connected above and below each other have a parent-child relationship. In our scene, Main is the parent, and Title, Player, and the Coin nodes are its children.
There's one important rule: a child's Position is relative to its parent. When the parent moves, its children move along with it.
- If you set
Main's Position to (100, 0), everything shifts 100 pixels to the right (set it back to (0, 0) after you try it). - If you drag
CoinontoPlayerin the Scene dock,Coinbecomes a child ofPlayer. Now when you move the character, the coin follows (undo it with Ctrl + Z after you try it).
One more thing: the lower a node is in the tree, the closer to the front it's drawn. To show the character in front of the coins, drag Player below the coins in the Scene dock.
Working with AI
Building a scene is easy to describe in words. Whichever approach you use, spelling out the node types, names, and positions makes it much more likely you'll get what you intended.
- A (chat): here you'll mostly have the AI explain the steps. It's good at answering questions like "How do I set an image on a Sprite2D?"
- B (Claude Code, etc.):
.tscnfiles are text, so the AI can edit them directly. However, Godot scene files have their own format (how IDs and references are written), and sometimes a file written by AI won't load. If that happens, give the error message to the AI and ask it to fix it. If it edits a scene you have open in the editor, you'll need to reload, as explained in Lesson 1. - C (+ MCP): instead of writing files, the AI adds and configures nodes inside the editor. Godot saves the file itself, so format mistakes don't happen. At the end, the AI can even take a screenshot of the editor to check for itself that the layout looks right.
Even when you work with AI, you'll use the words you learned in this lesson all the time: "node," "scene," "instance," and "parent-child." Knowing them makes your requests and the AI's explanations much easier to understand.
Recap and what's next
- A node is a building block that's good at one job. Sprite2D shows images; Label shows text
- Nodes arranged in a tree and saved as a file make a scene (.tscn)
- A scene can go inside another scene as a building block (instancing). Fix the original and every copy updates
- The top left is (0, 0), and y points down. A child's position is relative to its parent
- The lower a node is in the tree, the closer to the front it's drawn
Next time, we finally write code in GDScript. We'll move the character with the arrow keys and make the coins float.
Want AI to handle building scenes?
Godot MCP Pro is an MCP server that lets Claude Code or Cursor add nodes, set properties, instance scenes, and more, directly in the editor ($15 one-time purchase). It's fine to wait until you're comfortable building scenes by hand.