Back

Activity 2.1: Building a Scene from Nodes

divider

Activity 2.1

Building a Scene from Nodes

Key Concepts

Composition

Nodes, Scenes & Physics Bodies

Instancing

Composition

Almost nothing in a game is one giant, monolithic object. Complex things are built by combining small, simple pieces — the same way a LEGO model is built from individual bricks.

What Is a Node?

A Node is the smallest building block in Godot — a sprite, a shape, a sound, a physics body. Each one does one job.

What Is a Scene?

A Scene is a group of Nodes arranged together and saved as one reusable file — that's composition in action.

A Physics Body + A Picture

A RigidBody2D makes something obey physics. ASprite2D gives it a picture. Together, as parent and child, they make a visible object that can move and collide.

Physics Needs a Shape

A sprite is just a picture — the physics engine has no idea what part of it is "solid." ACollisionShape2D defines that explicitly, separate from how the object looks.

Instancing

Once a Scene is saved, you can place it —instance it — as many times as you want. Each instance is its own independent copy.

Today's Objectives

  • Building a reusable Player scene out of Nodes
  • Giving that scene a physics collision shape
  • Instancing it multiple times into your game

Key Terms

Node
The smallest building block in Godot.
Scene
A group of Nodes arranged together and saved as one reusable file.
RigidBody2D
A Node that obeys the physics engine — forces, gravity, collisions.
Sprite2D
A Node that displays a 2D image.
CollisionShape2D
A Node that defines the solid shape a physics body uses for collisions.
Instance
A placed copy of a saved Scene.

'F' → Fullscreen

divider

Build

Build a reusable Player scene, then place it into your game multiple times.


Task 1: Import Your Assets

  • Watch: Section 2, Lecture 2.2 — Project Setup (09:20)
  • Import the provided textures and audio (ship, asteroids, planets, star background, hurt sound) into your project's FileSystem panel.
[GIF PLACEHOLDER — Importing Project Assets]

Task 2: Build the Player Scene

  • Watch: Section 2, Lecture 2.3 — Nodes & Scenes (08:25)
  • Create a new scene with a RigidBody2D root node, renamed "Player".
  • Add a Sprite2D child and assign it the ship texture.
  • Save the scene as player.tscn.
[GIF PLACEHOLDER — Building the Player Scene]

Task 3: Add a Collision Shape

  • Watch: Section 2, Lecture 2.4 — Physics 101 (06:00)
  • Add a CollisionShape2D child to Player.
  • Assign it a Capsule shape, sized to roughly match the ship sprite.
[GIF PLACEHOLDER — Adding a Collision Shape]

Task 4: Instance Your Scene

  • Watch: Section 2, Lecture 2.5 — Instancing Scenes (07:24)
  • Open your main Game scene.
  • Instance the Player scene into it 2–3 times, at different positions.
[GIF PLACEHOLDER — Instancing the Player Scene]
divider

Checkpoint

You should see the following in the Godot editor:

  • Your Game scene contains multiple Player instances.
  • Each instance is a separate copy of the same player.tscn scene.
  • Each has its own Sprite2D and CollisionShape2D.
[GIF PLACEHOLDER — Multiple Player Instances in Game]
divider

Reflection

Answer the following questions before submitting your work.

  1. What is the difference between a Node and a Scene?
  2. Why does a RigidBody2D need a separate CollisionShape2D instead of just using its Sprite2D's picture as the collision shape?
  3. When you instance a scene multiple times, is each instance a completely separate copy, or do they all share the exact same data?
divider

Submit

Submit the required files to the appropriate dropbox.

Activity Complete