close game: F8
Export Templates need to be downloaded before exporting a game
Hiding a node does not disable it! To disable: In inspector under Node: Mode -> Disabled
Right-click a node β βAccess as a Unique Nameβ
Reload scene (through menu) after Theme changes to see them!
Topmost nodes in the tree are at the visual bottom
To save a theme as a file: in the inspector (wherever it is chosen), right-click Make Unique / Save As
To rescale TextureRects: set Expand Mode to Ignore Size
For settings e.g. create a script and add as an autoload, then you can refer to it everywhere e.g. GameManager.settings[βplayer_nameβ]
Contracts: e.g. βIf you can be damanged, you need a take_damage function!β and then a component looks for other components that have that function: if bla.has_method(βtake_damageβ): bla.take_damage()
Groups are like tags, a component can have many groups
if bla.is_in_group(βenemyβ)
var all_in_group = get_tree().get_nodes_in_group(βenemyβ)
Signal Relays: A β B β C ?
Resources:
class_name Item extends Resource
and add export variablesBasic Components
Editor Settings:
Project Settings:
Export Settings:
Node2D (Game Objects):
Controls (UI):
Others:
var
or const
float
_var position := Vector2(5, 5)
str(1)
, int("1")
pass
keyword for empty ifs etcscale += Vector2(0.2, 0.2)
Color.BLACK
var my_node_path:NodePath
var my_scenes:Array[PackedScene] = []
enum Season { SPRING, SUMMER, FALL, WINTER }
@export var damage := 15
will let you change the variable in the inspector of the node{ "bla":1, "blub":2 }
The keys can have any type, but must be uniquematch
, the default is _:
$
for referencing nodes is shortcode for get_node()
)if my_node is Node2D:
var health := 100: set(value): health = value
value1 if condition else value2
propogate_call(βdo_somethingβ)