Godot Game Development Beginner Guide: From Nodes and Scenes to Your First 2D Game

A beginner-friendly Godot game development guide covering nodes, scenes, scripts, input, physics, resource organization, and a first 2D game route from project creation to movement, collision, UI, audio, and export.

Godot is an open-source game engine suitable for 2D games, independent prototypes, and medium-scale 3D projects.

Its biggest strengths are that it is lightweight, open source, fast to start, and built around a clear node-and-scene model. For beginners, Godot is usually easier to approach than Unity. For independent developers, it is also easier to keep projects small and controllable.

This guide keeps the path simple: understand nodes and scenes, learn basic GDScript, then build a small 2D game that connects input, physics, collision, UI, audio, and export.

Bottom line

Do not start by learning every engine feature.

A better path is:

  1. Start with 2D, not 3D.
  2. Understand nodes and scenes before complex architecture.
  3. Learn GDScript first, not C#.
  4. Build one small game that can start, fail, and restart.
  5. Then add animation, audio, UI, levels, and export.

Completing one tiny game teaches more than watching many unrelated tutorials.

Who Godot is good for

Godot is a strong fit if you:

  • want to learn game development from zero,
  • want to build 2D indie games,
  • need fast gameplay prototypes,
  • do not want a heavy commercial engine workflow,
  • want to understand how engines organize game objects,
  • have some Python or JavaScript experience and want an easy scripting language.

Unity and Unreal still have advantages for large commercial pipelines, asset stores, mobile monetization SDKs, or high-end 3D visuals. But for learning and making your own games, Godot is an excellent starting point.

Installation and project creation

Godot is simple to install: download it from the official website, unzip it, and run it.

For the first project:

  • Use the default renderer.
  • Use an English project name.
  • Avoid paths with too many spaces or non-ASCII characters.
  • Use Git from the beginning.

A simple project name:

1
first-godot-game

Learn the editor areas first: Scene tree, FileSystem, Inspector, Script editor, and 2D / 3D viewport.

Core idea: nodes and scenes

The two most important Godot concepts are nodes and scenes.

Nodes are functional units:

  • Node2D: base 2D object.
  • Sprite2D: displays an image.
  • CollisionShape2D: collision shape.
  • CharacterBody2D: controllable character.
  • Camera2D: 2D camera.
  • AudioStreamPlayer: audio playback.
  • Label: text display.

A scene is a reusable group of nodes. A player can be a scene, an enemy can be a scene, and a level can be a scene.

For example:

1
2
3
4
Player (CharacterBody2D)
├── Sprite2D
├── CollisionShape2D
└── Camera2D

The player handles movement, Sprite2D displays the image, CollisionShape2D handles collision, and Camera2D follows the player.

What to build first

Do not start with an RPG, open world, networking, or complex platformer.

Build a tiny 2D dodging game:

  • The player moves up, down, left, and right.
  • Enemies spawn from screen edges.
  • Touching an enemy means failure.
  • Survival time becomes score.
  • There is a start button, game-over screen, and restart.

This small project covers movement, input, collision, spawning, UI, timers, audio, and scene reloads.

Player movement

Use CharacterBody2D for a controllable player.

Attach a script to Player:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
extends CharacterBody2D

@export var speed := 300.0

func _physics_process(delta):
    var direction := Vector2.ZERO

    direction.x = Input.get_axis("move_left", "move_right")
    direction.y = Input.get_axis("move_up", "move_down")
    direction = direction.normalized()

    velocity = direction * speed
    move_and_slide()

Then define input actions:

1
2
3
4
move_left  -> A / Left
move_right -> D / Right
move_up    -> W / Up
move_down  -> S / Down

Use input actions instead of hard-coded key codes. It makes keyboard, gamepad, touch, and remapping easier later.

Collision and physics

Common 2D nodes:

  • CollisionShape2D: defines collision shape.
  • Area2D: detects overlap and triggers.
  • CharacterBody2D: player or controlled character.
  • RigidBody2D: physics-driven object.
  • StaticBody2D: walls, floors, fixed obstacles.

For beginners: if you control movement manually, use CharacterBody2D. If you only need to detect contact, use Area2D.

Example:

1
2
3
func _on_body_entered(body):
    if body.name == "Player":
        get_tree().reload_current_scene()

Later, replace direct reloads with a game_over signal. For the first project, getting the loop working is more important.

Instancing enemies

Godot scenes can be used like prefabs.

If you have Enemy.tscn, spawn it from the main scene:

1
2
3
4
5
6
@export var enemy_scene: PackedScene

func spawn_enemy():
    var enemy = enemy_scene.instantiate()
    enemy.position = Vector2(800, randf_range(50, 550))
    add_child(enemy)

Add a Timer to call spawn_enemy() repeatedly.

UI and score

Use Control nodes for UI:

  • CanvasLayer: keeps UI fixed on screen.
  • Label: text.
  • Button: button.
  • Panel: background.
  • VBoxContainer / HBoxContainer: layout.

Simple survival score:

1
2
3
4
5
var score := 0.0

func _process(delta):
    score += delta
    $CanvasLayer/ScoreLabel.text = str(int(score))

Audio and feedback

Even simple games need feedback:

  • click sounds,
  • hit sounds,
  • score sounds,
  • failure sounds,
  • screen shake or flash,
  • button hover / pressed states.

Use AudioStreamPlayer:

1
$HitSound.play()

Functionality is only the first step. Good feedback makes the player feel the game responding.

Project organization

Start with clean folders:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
res://
├── scenes/
│   ├── Main.tscn
│   ├── Player.tscn
│   └── Enemy.tscn
├── scripts/
│   ├── player.gd
│   └── enemy.gd
├── assets/
│   ├── sprites/
│   └── audio/
└── ui/
    └── GameOver.tscn

Do not dump everything into the root directory. Small games grow faster than expected.

Common beginner mistakes

  • Choosing the wrong node type.
  • Forgetting collision shapes.
  • Hard-coding keyboard keys.
  • Putting player, enemies, UI, audio, and level logic into one script.
  • Starting with a project that is too large.

A tiny finished game is more valuable than an abandoned big idea.

Suggested learning path

  1. Editor basics.
  2. Nodes and scenes.
  3. GDScript basics.
  4. Input actions.
  5. 2D movement.
  6. Collision and Area2D.
  7. Timer and spawning.
  8. UI and score.
  9. Audio and animation.
  10. Export to desktop or web.

Godot vs Unity

Godot is comfortable for 2D indie games, teaching projects, and personal prototypes.

Unity still has stronger asset stores, commercial plugins, mobile ads, monetization SDKs, and mature team workflows.

Unreal is better for high-end 3D and advanced rendering.

For beginners, do not let engine choice become procrastination. The core skills are game loops, input, collision, feedback, scene organization, state management, and version control.

Completion checklist

You have really completed the first step when your game has:

  • player movement,
  • enemies or obstacles,
  • collision failure,
  • score or objective,
  • start screen,
  • game-over screen,
  • restart,
  • at least two sounds,
  • simple animation or visual feedback,
  • an exported playable build.

Summary

Godot’s entry point is not memorizing every feature. It is understanding how the engine organizes games: nodes form scenes, scenes form games, scripts drive behavior, signals connect events, and resources live in folders.

Start with a small 2D game. Once movement, collision, UI, audio, and restart work, then learn animation trees, TileMap, saving, state machines, 3D, shaders, and export optimization.

记录并分享
Built with Hugo
Theme Stack designed by Jimmy