Skip to main content
Consistent code style makes it easier to read, review, and maintain the project. Follow these rules whether you’re writing new code or editing existing files.

Bilingual policy

Beast Card Clash enforces a strict bilingual split:
WhatLanguage
Code (identifiers, variables, functions, class names)English
CommentsSpanish
Documentation stringsSpanish
Commit messagesSpanish or English
# Configura el jugador humano con los datos guardados en PlayerStats
func setup_player() -> void:
    player = Player.new(PlayerStats.player_name, PlayerStats.team, false)
    player.create_deck()
    players.append(player)
C# follows its own standard conventions (Microsoft’s C# coding guidelines). The rules below apply primarily to GDScript.

Naming conventions

Variables and functions

Use snake_case for all variables, function names, and parameters.
# Correcto
var player_name: String
var battle_ui: Control
var max_players: int = 4

func get_current_player() -> Player:
    pass

func apply_card_effect(card: Card, target: Character) -> void:
    pass
# Incorrecto
var playerName: String       # camelCase — not allowed
var MaxPlayers: int          # PascalCase — reserved for types
func GetCurrentPlayer():     # PascalCase — not allowed for functions
    pass

Classes and types

Use PascalCase for class names and type identifiers.
class_name BattleManager
class_name CardScene
class_name BattleState

Constants

Use SCREAMING_SNAKE_CASE for constants.
const MAX_CARD_VAlUE: int = 10   # Note: typo in source ("VAlUE" not "VALUE")
const ONDULAION_SPEED := 3.5     # Note: typo in source ("ONDULAION" not "ONDULATION")
const MAX_PLAYERS := 4

Enums

Enum type names use PascalCase. Enum values use SCREAMING_SNAKE_CASE.
enum Elements { FIRE, WATER, EARTH, AIR, ENERGY }
enum Teams { ADN, ACETILES, PHOTO_AGROS, PLUMA_DORADA }
enum BattlePhase { START, LOOP, TURN, REFEREE, END }
Access enum values with the type name:
var current_element: Elements = Elements.FIRE
var player_team: Teams = Teams.ADN

Summary table

Identifier typeConventionExample
Variablesnake_caseplayer_name, battle_ui
Functionsnake_caseget_current_player()
Parametersnake_casecard: Card, target: Character
Class / typePascalCaseBattleManager, CardScene
ConstantSCREAMING_SNAKE_CASEMAX_CARD_VALUE, ONDULATION_SPEED
Enum (name)PascalCaseElements, Teams
Enum (value)SCREAMING_SNAKE_CASEElements.FIRE, Teams.ADN

File and scene naming

WhatConventionExample
GDScript filessnake_case.gdbattle_manager.gd, player_stats.gd
Scene filessnake_case.tscnbattle_scene.tscn, cards_list.tscn
C# filesPascalCase.csBattleManager.cs
Scene nodesPascalCaseStateMachine, BattleUI, Dice
Scene node names and script/file names follow different conventions. A node in the scene tree is PascalCase (e.g., BattleUI), but its associated file is snake_case (e.g., battle_ui.tscn).

Project folder structure

The project uses color-coded folders in the Godot editor to communicate the role of each directory at a glance.
beast_card_clash
addons
assets
battle
cards
characters
elements
tests
ui
autoload
.vscode
FolderColorPurpose
res://addons/TealGodot plugins and third-party tools
res://assets/YellowAll game content: cards, characters, UI, music, shaders
res://assets/tests/RedTest scenes and assets — not shipped in release builds
res://autoload/BlueSingleton scripts loaded at startup (global state, managers)
The autoload/ folder (blue) contains scripts that are always available globally — things like MusicManager, FlagsManager, and SceneManager. See the autoloads reference for details.

GDScript vs C#

GDScript is the primary language for Beast Card Clash. All rules on this page apply directly to GDScript files.
class_name BattleManager
extends Node

const MAX_PLAYERS: int = 4

var current_turn: int = 0
var active_player: Player

enum BattlePhase { START, LOOP, TURN, REFEREE, END }

# Inicia una nueva ronda y notifica a los jugadores
func start_round() -> void:
    current_turn += 1
    emit_signal("round_started", current_turn)

Consistency checklist

Before submitting a pull request, verify that your code follows these rules:
  • All identifiers (variables, functions, classes, files) are in English
  • All inline comments are in Spanish
  • Spelling is correct — double-check both English identifiers and Spanish comments
  • Variables and functions use snake_case
  • Classes and type names use PascalCase
  • Constants use SCREAMING_SNAKE_CASE
  • Enum names use PascalCase, enum values use SCREAMING_SNAKE_CASE
  • Scene nodes use PascalCase
  • Scene and script files use snake_case
  • New scripts are placed in the appropriate assets/ subfolder
  • Global singletons belong in autoload/
  • Test files go in assets/tests/ and are not mixed with production assets
  • The .vscode/ directory has not been modified
  • C# files are named to match their class name (BattleManager.cs contains class BattleManager)
  • C# follows Microsoft’s standard C# coding guidelines, not GDScript conventions

Contributing

Branch naming, commit guidelines, and the pull request workflow.

Architecture overview

How the project is structured and how systems connect.

Build docs developers (and LLMs) love