Syntax & types (the atoms)
Yes, we start at integers. No, you cannot skip to shaders yet.
What is GDScript?
Godot's Python-like language. Indentation matters. Colons start blocks. You attach scripts to nodes.
Integers (int)
Whole numbers: health, scores, ammo counts.
var hp: int = 100 var coins := 3 # := guesses the type
Floats (float)
Decimals: speed, timers, percentages.
var speed: float = 220.5 var dt: float = 0.016
Strings & bools
Text and true/false.
var name: String = "Hero"
var alive: bool = true
print("Hi %s" % name)var vs const
var can change. const cannot โ use for max HP, gravities, IDs.
const MAX_HP := 100 var hp := MAX_HP hp -= 10 # ok # MAX_HP = 200 # error
Operators
+ - * / % and comparisons == != < > <= >= and logic and / or / not
var dmg = 5 * 2
if hp <= 0 and alive:
alive = false