Download Godot#
- You can download the original version of Godot engine from the official website.
Advantages: Supports multiple platforms such as Linux, Windows, and Mac.
The Mono version supports other languages such as C#.
- Godot Enhanced Edition
- Use this link to download Godot Enhanced Edition 3.4.4 (not the latest version).
This version is for Windows.
Common Syntax#
Var + name // Same usage as C#
Specify content
① name = 123
② var name = 123 // Specify type when assigning a value, must be initialized.
Once specified, the content cannot be changed to another type.
int type rounds towards 0, float rounds down when assigning a value.
Type is automatically determined based on the content.
Can use ' ' and " "
Supports Chinese characters.
Converts variable to string using str(variable).
Two-dimensional vectors
Var vec2 = Vector2.ZERO
Var vec3 = Vector3.ZERO
Object types
Var obj = { }
Host types
Var arr = [ ]
Conditional Statements#
Note:
When elif statements exist and multiple conditions are met, the previous one is executed first.
Common if Conditions#
!= not
You understand, pay attention to the symbols.
Empty variables default to false.
Empty default values are 0.
Other values are true.
Comments#
Ctrl + k for batch commenting.
# for line comments.
Loops#
for loop#
A loop from 0 to 5.
while loop
Arrays#
Simple usage
Adding multiple content
Objects#
Stores variables in an array-like manner.
Values can be accessed like an array.
Functions#
Basic usage of functions
Output#
Prefix variables with export
Allows real-time preview and modification of data in the root node.
Graphical Layering#
queue_free()
Deletes the parent node.