Skip to main content

GDScript

Classes

In gdscript, a file is a class.

# set X as available anywhere, so you dont need to load the file from path.
class_name X
# set that class X inherit class Y
extends Y
# declare an inner class in the file
class Z

Class constructor

func _init(arg):
# use arg here or pass it to the mother class with super
super(arg,"fixed arg")