GAMINODE Docs
Docs / Editor

Scenes and nodes

A Gaminode game is a tree of nodes. Each node does one job, and a scene is a tree of nodes saved to a file that you can reuse anywhere, as many times as you like.

Nodes

A node has a name, a type, settings in the Inspector, and children. The type decides what it does. You build anything by combining simple nodes:

A playerPlayer (CharacterBody2D)      moves and collides
├── Sprite2D                   draws the picture
├── CollisionShape2D           gives it a body
├── AnimationPlayer            plays animations
└── Jump (AudioStreamPlayer)   plays a sound

Scenes

Save a node tree as a .tscn file and it becomes a scene. A scene can be a whole level or one bullet. You put scenes inside other scenes by instancing them: drag the .tscn from FileSystem into the viewport, or press the chain-link button in the Scene panel.

Change the original scene and every instance follows. Change one instance in the Inspector and only that one changes.

Spawning a scene from codeconst BULLET := preload("res://bullet.tscn")

func shoot() -> void:
	var b := BULLET.instantiate()
	b.global_position = global_position
	get_parent().add_child(b)

Node types you'll use most

NodeFor
Node2D / Node3DA position in 2D or 3D space; good as a root or a folder
Sprite2D, AnimatedSprite2DPictures and frame animations
MeshInstance3DA 3D model
CharacterBody2D/3DPlayers and enemies you move from code with move_and_slide()
RigidBody2D/3DThings moved by physics: balls, crates
StaticBody2D/3DFloors and walls
Area2D/3DTrigger zones and pickups: tells you when something enters
CollisionShape2D/3DThe shape of a body or area (every body needs one)
Camera2D/3DWhat the player sees
TimerDo something every few seconds
AudioStreamPlayerMusic and sounds
Control, Label, Button, VBoxContainerMenus and the HUD
CanvasLayerKeeps the HUD on top and still while the camera moves

Signals

A signal is a message a node sends when something happens. Connect it in the Node tab next to the Inspector, or in code:

func _ready() -> void:
	$Button.pressed.connect(_on_play_pressed)
	$Coin.body_entered.connect(_on_coin_touched)

func _on_play_pressed() -> void:
	get_tree().change_scene_to_file("res://scenes/Main.tscn")

Make your own with signal died and send it with died.emit().

Groups

Groups are labels on nodes, for finding many at once. Add one in Node > Groups or with add_to_group("enemies").

for e in get_tree().get_nodes_in_group("enemies"):
	e.queue_free()

The main scene

The main scene is the one F5 and exported games start with. Set it in Project > Project Settings > Application > Run. Health Check warns you if it's missing.

Something wrong or missing on this page? Email gaminodeofficial@gmail.com.