Browse Source

Merge pull request #554 from cbscribe/gds_styleguide

Additions to GDScript styleguide
Chris Bradfield 7 years ago
parent
commit
89834bc4dc
1 changed files with 17 additions and 1 deletions
  1. 17 1
      learning/scripting/gdscript/gdscript_styleguide.rst

+ 17 - 1
learning/scripting/gdscript/gdscript_styleguide.rst

@@ -162,7 +162,13 @@ ugly.
 Classes and Nodes
 ~~~~~~~~~~~~~~~~~
 
-Use CapWords, or PascalCase: ``extends KinematicBody``
+Use PascalCase: ``extends KinematicBody``
+
+Also when loading a class into a constant or variable:
+
+::
+    
+    const MyCoolNode = preload('res://my_cool_node.gd')
 
 Functions and Variables
 ~~~~~~~~~~~~~~~~~~~~~~~
@@ -173,6 +179,16 @@ Prepend a single underscore (\_) to virtual methods (functions the user
 must override), private functions, and private variables:
 ``func _ready()``
 
+Signals
+~~~~~~~
+
+Use past tense:
+
+::
+    
+    signal door_opened
+    signal score_changed
+
 Constants
 ~~~~~~~~~