File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
tutorials/scripting/gdscript Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -186,11 +186,11 @@ indentation level to distinguish continuation lines:
186186 "Job": "Mechanic",
187187 }
188188
189- enum Tiles {
190- TILE_BRICK ,
191- TILE_FLOOR ,
192- TILE_SPIKE ,
193- TILE_TELEPORT ,
189+ enum Tile {
190+ BRICK ,
191+ FLOOR ,
192+ SPIKE ,
193+ TELEPORT ,
194194 }
195195
196196**Bad **:
@@ -211,11 +211,11 @@ indentation level to distinguish continuation lines:
211211 "Job": "Mechanic",
212212 }
213213
214- enum Tiles {
215- TILE_BRICK ,
216- TILE_FLOOR ,
217- TILE_SPIKE ,
218- TILE_TELEPORT ,
214+ enum Tile {
215+ BRICK ,
216+ FLOOR ,
217+ SPIKE ,
218+ TELEPORT ,
219219 }
220220
221221Trailing comma
@@ -738,7 +738,7 @@ underscore (\_) to separate words:
738738
739739 const MAX_SPEED = 200
740740
741- Use PascalCase for enum *names * and CONSTANT\_ CASE for their members, as they
741+ Use PascalCase for enum *names * and keep them singular, as they represent a type. Use CONSTANT\_ CASE for their members, as they
742742are constants:
743743
744744::
@@ -872,7 +872,7 @@ variables, in that order.
872872
873873 signal player_spawned(position)
874874
875- enum Jobs {
875+ enum Job {
876876 KNIGHT,
877877 WIZARD,
878878 ROGUE,
@@ -882,7 +882,7 @@ variables, in that order.
882882
883883 const MAX_LIVES = 3
884884
885- @export var job: Jobs = Jobs .KNIGHT
885+ @export var job: Job = Job .KNIGHT
886886 @export var max_health = 50
887887 @export var attack = 5
888888
You can’t perform that action at this time.
0 commit comments