27 lines
2.2 KiB
Markdown
27 lines
2.2 KiB
Markdown
# AGENTS.md
|
|
Godot 4.6 idle-game; code is GDScript + `.tscn` scenes.
|
|
|
|
## Build, Lint, And Test Commands
|
|
Use `GODOT_BIN` for your local editor binary (e.g. `godot`, `godot4`, or full path).
|
|
Run project: `"$GODOT_BIN" --path .`
|
|
Headless smoke/lint parse: `"$GODOT_BIN" --headless --path . --quit`
|
|
Script syntax check (single script): `"$GODOT_BIN" --headless --check-only --script res://big_number.gd`
|
|
Tests: no test framework is currently committed (`tests/` and `addons/gut` are absent).
|
|
Single-test command: N/A right now; if GUT is added, use `"$GODOT_BIN" --headless --path . -s res://addons/gut/gut_cmdln.gd -gtest=res://tests/<file>.gd`.
|
|
|
|
## Architecture And Structure
|
|
`project.godot` defines autoload singletons: `GameState` (runtime currency state + save/load) and `CurrencyGeneratorDatabase` (loads `generator_data.json`).
|
|
`big_number.gd` (`class_name BigNumber`) is the internal numeric API for huge-value math, comparisons, formatting, and serialization.
|
|
`big_number_museum.tscn` + `big_number_museum.gd` is the current main playable scene/prototype UI.
|
|
`currency_generator.gd`, `currency_label.gd`, and `big_number_progress_bar.gd` are UI/gameplay adapters that react to `GameState` signals.
|
|
Persistence is local JSON only: `user://idle_save.json`; there is no external DB/server/backend.
|
|
|
|
## Code Style And Conventions
|
|
Prefer typed GDScript (`var x: Type`, `func f() -> void`) and keep shared models/components as `class_name` scripts.
|
|
Naming: `snake_case` for vars/functions/signals, `PascalCase` for classes, `UPPER_SNAKE_CASE` for constants.
|
|
Follow existing Godot style: tabs/consistent indentation, early returns, and short functions grouped by purpose.
|
|
When reading files/JSON, always guard `FileAccess.open(...)` and validate parsed types before indexing.
|
|
Use signals (already in `GameState`) for UI updates instead of polling or cross-node direct mutation.
|
|
No Cursor/Claude/Windsurf/Cline/Goose/Copilot rule files were found in this repository, so this file is the canonical agent guidance.
|
|
Avoid trivial one-line wrapper/helper functions that only forward or repack data. Inline the logic at the real call site unless the wrapper adds meaningful abstraction or is reused enough to justify it.
|