File tree 1 file changed +13
-13
lines changed
tutorials/scripting/gdscript 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:
186
186
"Job": "Mechanic",
187
187
}
188
188
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 ,
194
194
}
195
195
196
196
**Bad **:
@@ -211,11 +211,11 @@ indentation level to distinguish continuation lines:
211
211
"Job": "Mechanic",
212
212
}
213
213
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 ,
219
219
}
220
220
221
221
Trailing comma
@@ -738,7 +738,7 @@ underscore (\_) to separate words:
738
738
739
739
const MAX_SPEED = 200
740
740
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
742
742
are constants:
743
743
744
744
::
@@ -872,7 +872,7 @@ variables, in that order.
872
872
873
873
signal player_spawned(position)
874
874
875
- enum Jobs {
875
+ enum Job {
876
876
KNIGHT,
877
877
WIZARD,
878
878
ROGUE,
@@ -882,7 +882,7 @@ variables, in that order.
882
882
883
883
const MAX_LIVES = 3
884
884
885
- @export var job: Jobs = Jobs .KNIGHT
885
+ @export var job: Job = Job .KNIGHT
886
886
@export var max_health = 50
887
887
@export var attack = 5
888
888
You can’t perform that action at this time.
0 commit comments