Skip to content

Coding Standards

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

Naming Conventions

No numbers in names except for files!!!

Variables: camelCase

var exampleVariable

Constants: ALL_CAPS

const EXAMPLE_CONSTANT

Enums: Names: PascalCase, Members: ALL_CAPS

enum ExampleEnum {
WALKING,
IDLE,
JUMPING
}

Functions: snake_case

func example_function_name():

Classes: PascalCase

class BaseEnemyClass

Files/Scenes/Scripts: 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