2.5 KiB
2.5 KiB
Repository Guidelines
Project Structure & Module Organization
- Godot 4.5 C# project (
导师模拟器.csproj,project.godot) targeting .NET 8; main scene isscenes/logo_scene.tscn. - Gameplay scripts live in
scripts/; AI task assets inai/(ai/tasksfor logic,.tresfor definitions). - Scenes sit in
scenes/; shared art/audio inresources/and placeholder art intemp_res/; shaders inshaders/; plugins inaddons/; animation clips inAnimation/. - Add new scenes under
scenes/and attach scripts there; keep reusable utilities inscripts/Helpers*or a newscripts/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 buildcompiles the game code against Godot assemblies.godot4 .runs the game with the configured main scene;godot4 --editoropens the project for level/content work.- Optional:
dotnet formatto 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; preferres://. - When exporting variables, prefer
[Export] publicproperties/fields with descriptive names.
Testing Guidelines
- No automated tests are present yet; prefer lightweight Godot script tests or
dotnet testonce atests/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 intemp_res/and clean before release. - Modify project settings through the Godot editor rather than hand-editing
project.godot; updaterun/main_sceneif the entry scene moves.