# Repository Guidelines ## Project Structure & Module Organization - Godot 4.5 C# project (`导师模拟器.csproj`, `project.godot`) targeting .NET 8; main scene is `scenes/logo_scene.tscn`. - Gameplay scripts live in `scripts/`; AI task assets in `ai/` (`ai/tasks` for logic, `.tres` for definitions). - Scenes sit in `scenes/`; shared art/audio in `resources/` and placeholder art in `temp_res/`; shaders in `shaders/`; plugins in `addons/`; animation clips in `Animation/`. - Add new scenes under `scenes/` and attach scripts there; keep reusable utilities in `scripts/Helpers*` or a new `scripts/common/` subfolder. ## Build, Test, and Development Commands - `godot4 --headless --build-solutions` (or the Godot 4.5.1 Windows exe) regenerates C# bindings after adding scripts. - `dotnet build` compiles the game code against Godot assemblies. - `godot4 .` runs the game with the configured main scene; `godot4 --editor` opens the project for level/content work. - Optional: `dotnet format` to auto-format C# before committing. ## Coding Style & Naming Conventions - Match existing style: tabs for indentation, partial classes inheriting from Godot nodes, PascalCase for classes/methods, camelCase for fields, ALL_CAPS for constants. - Keep resource paths lowercase with underscores (`scenes/logo_scene.tscn`, `resources/...`). Avoid absolute OS paths; prefer `res://`. - When exporting variables, prefer `[Export] public` properties/fields with descriptive names. ## Testing Guidelines - No automated tests are present yet; prefer lightweight Godot script tests or `dotnet test` once a `tests/` project is added. - Aim to cover input handling, drag/drop, and scene transitions (`SceneTransit`, `GameManager`) when adding tests. Document new test commands in PRs. ## Commit & Pull Request Guidelines - Use short, imperative commit titles similar to existing history (e.g., "Cube drag and drop", "Watch mobile phone"); add a scope tag when helpful (`[scripts] Fix drag`). English is preferred; bilingual is acceptable. - PRs should state the behavior change, files/scenes touched, test commands run, and include screenshots or GIFs for visual changes. Link related issues/tasks and keep PRs focused/small. ## Asset & Configuration Tips - Commit Godot import metadata (`*.import`, `.godot/`) alongside assets to avoid reimport churn. - Keep reusable assets in `resources/`; stash throwaway or WIP art in `temp_res/` and clean before release. - Modify project settings through the Godot editor rather than hand-editing `project.godot`; update `run/main_scene` if the entry scene moves.