From 60b7284184619dea1d129769df298e5040f9d74d Mon Sep 17 00:00:00 2001 From: Chris Bradfield Date: Sun, 22 Oct 2017 17:58:36 -0700 Subject: [PATCH] Additions to GDScript styleguide --- .../scripting/gdscript/gdscript_styleguide.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/learning/scripting/gdscript/gdscript_styleguide.rst b/learning/scripting/gdscript/gdscript_styleguide.rst index 14f46807..e6302649 100644 --- a/learning/scripting/gdscript/gdscript_styleguide.rst +++ b/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 ~~~~~~~~~