Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tutorials/scripting/gdscript/gdscript_styleguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ indentation level to distinguish continuation lines:
"Job": "Mechanic",
}

enum Tiles {
TILE_BRICK,
TILE_FLOOR,
TILE_SPIKE,
TILE_TELEPORT,
enum Tile {
BRICK,
FLOOR,
SPIKE,
TELEPORT,
}

**Bad**:
Expand All @@ -211,11 +211,11 @@ indentation level to distinguish continuation lines:
"Job": "Mechanic",
}

enum Tiles {
TILE_BRICK,
TILE_FLOOR,
TILE_SPIKE,
TILE_TELEPORT,
enum Tile {
BRICK,
FLOOR,
SPIKE,
TELEPORT,
}

Trailing comma
Expand Down Expand Up @@ -738,7 +738,7 @@ underscore (\_) to separate words:

const MAX_SPEED = 200

Use PascalCase for enum *names* and CONSTANT\_CASE for their members, as they
Use PascalCase for enum *names* and keep them singular, as they represent a type. Use CONSTANT\_CASE for their members, as they
are constants:

::
Expand Down Expand Up @@ -872,7 +872,7 @@ variables, in that order.

signal player_spawned(position)

enum Jobs {
enum Job {
KNIGHT,
WIZARD,
ROGUE,
Expand All @@ -882,7 +882,7 @@ variables, in that order.

const MAX_LIVES = 3

@export var job: Jobs = Jobs.KNIGHT
@export var job: Job = Job.KNIGHT
@export var max_health = 50
@export var attack = 5

Expand Down
Loading