Skip to content

Commit 5b15d19

Browse files
authored
Merge pull request #10295 from tetrapod00/gdscript-summary
Add GDScript naming convention summary table
2 parents b82187d + c1310e6 commit 5b15d19

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

tutorials/scripting/gdscript/gdscript_styleguide.rst

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,29 @@ Naming conventions
620620

621621
These naming conventions follow the Godot Engine style. Breaking these will make
622622
your code clash with the built-in naming conventions, leading to inconsistent
623-
code.
623+
code. As a summary table:
624+
625+
+---------------+----------------+----------------------------------------------------+
626+
| Type | Convention | Example |
627+
+===============+================+====================================================+
628+
| File names | snake_case | ``yaml_parser.gd`` |
629+
+---------------+----------------+----------------------------------------------------+
630+
| Class names | PascalCase | ``class_name YAMLParser`` |
631+
+---------------+----------------+----------------------------------------------------+
632+
| Node names | PascalCase | ``Camera3D``, ``Player`` |
633+
+---------------+----------------+----------------------------------------------------+
634+
| Functions | snake_case | ``func load_level():`` |
635+
+---------------+----------------+----------------------------------------------------+
636+
| Variables | snake_case | ``var particle_effect`` |
637+
+---------------+----------------+----------------------------------------------------+
638+
| Signals | snake_case | ``signal door_opened`` |
639+
+---------------+----------------+----------------------------------------------------+
640+
| Constants | CONSTANT_CASE | ``const MAX_SPEED = 200`` |
641+
+---------------+----------------+----------------------------------------------------+
642+
| Enum names | PascalCase | ``enum Element`` |
643+
+---------------+----------------+----------------------------------------------------+
644+
| Enum members | CONSTANT_CASE | ``{EARTH, WATER, AIR, FIRE}`` |
645+
+---------------+----------------+----------------------------------------------------+
624646

625647
File names
626648
~~~~~~~~~~

0 commit comments

Comments
 (0)