-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Standards
Theo Ruefli edited this page May 21, 2026
·
41 revisions
No numbers in names except for files!
Variables:
- Name: camelCase
var exampleVariableConstants:
- Name: ALL_CAPS
const EXAMPLE_CONSTANTEnums:
- Name: PascalCase
- Members: ALL_CAPS
enum ExampleEnum {
WALKING,
IDLE,
JUMPING
}Functions:
- Name: snake_case
- Parameters: camelCase
func example_function_name():Classes:
- Name: PascalCase
class BaseEnemyClassFiles/Scenes/Scripts:
- Name: PascalCase
res://LevelFolder
TutorialLevel.tscn
PlayerScript.gd
Always include a single space between the start of a comment and the first word, additionally always capitalize the first letter! When writing particularly complex code that might be hard to follow, provide adequate description.
Variables:
- 1 Hashtag
- Appears above declaration
- Related variables/comments grouped together for clarity, groups separated by spacing
# My cool variables
var myVariable: int
var myOtherVariable: bool = true
# My monetary variables
var dollars: int
var cents: int
# My unrelated variable
const myUnrelatedVariable = 42Functions:
- 2 Hashtags
- Appears above function
- 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 + yTags
- 1 Hashtag
- Appears above related section
- ALL CAPS no spaces
- Use tags throughout code for actionable/notable items
# BUG: [Description of bug]
# TODO: [Description of work that still needs to be done]
# STRETCH: [Short description of stretch goal that would go here]Resources
Known Issues
Future Work
Globals
Managers
- Main Menu Manager
- Master Manager
- Camera Manager
- Hotkey Manager
- Import Export Manager
- Audio Manager
- Animation Manager
- PopUp Manager
UI
Managers
- Editor Manager
- Tile Manager
- Entity Manager
- Icon Manager
- Preview Manager
- Tool Manager
- Asset Manager
- Custom Cursor Manager
Tiles & Entities
- Grid Lines
- Preview Line
- Tiles & Entities
- Enemies
- Patrolling Enemy
- Flying Enemy
- Shooting Enemy
- Stationary Enemy
- Moving Platform
- Property Editing
Asset Swapping
UI
Managers
Player