Skip to content

Coding Standards

Theo Ruefli edited this page May 21, 2026 · 41 revisions

Coding Standards


Naming Conventions

No numbers in names except for files!!!

Variables:

  • Name: camelCase
var exampleVariable

Constants:

  • Name: ALL_CAPS
const EXAMPLE_CONSTANT

Enums:

  • Name: PascalCase
  • Members: ALL_CAPS
enum ExampleEnum {
WALKING,
IDLE,
JUMPING
}

Functions:

  • Name: snake_case
  • Parameters: camelCase
func example_function_name():

Classes:

  • Name: PascalCase
class BaseEnemyClass

Files/Scenes/Scripts:

  • Name: PascalCase
res://LevelFolder
TutorialLevel.tscn
PlayerScript.gd

Commenting

Always include a single space between the start of a comment and the first word, additionally always capitalise the first letter.

Functions:

  • 2 Hashtags
  • Summary of the functions
  • Descriptions of the fields
  • Return value
  • Comments in code blocks where necessary describing complex sections
  • Include any references/resources used
## Adds two numbers together
## x: First number 
## y: Second number 
## Returns the sum of both numbers
## https://stackoverflow.com/questions
func add_nums(x: int, y: int) -> int:
	# Adds both numbers together
	return x + y

Clone this wiki locally