2.5 KiB
2.5 KiB
Dungeon Crawler World — S3 Combat HUD
Prerequisites
Godot 4.2+ (verified with Godot 4.5) is required. GUT 9.5.0 is vendored and pinned at addons/gut.
Run
"${GODOT_BIN:-$(command -v godot4 || command -v godot)}" --path .
Use WASD / arrow keys (and QEZC diagonals). The deterministic public E2E seam is Game.submit_test_action(Vector2i); it calls the same action processor as keyboard input.
Tests
GODOT_BIN=/snap/bin/godot4 ./scripts/test-unit.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/test-e2e.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/verify.sh
Scripts use GODOT_BIN, otherwise discover godot4, then godot, and run headlessly.
Exploration et FOV
- Les cellules actuellement dans
GameState.visible_cellssont affichées à pleine luminosité. - Les cellules présentes seulement dans
GameState.explored_cellsrestent visibles, mais sont assombries ; les cellules inconnues sont noires. - La FOV est calculée contre la carte : les murs et portes fermées restent visibles mais masquent les cases situées derrière eux.
- Le rendu est synchronisé après chaque action via le même chemin que les entrées clavier et
Game.submit_test_action(Vector2i).
Combat HUD
HUD/PlayerHealthLabelandHUD/EnemyHealthLabelshow current hit points; the latter reportsNo active targetafter the goblin is defeated.HUD/CombatSummaryLabelis the separate public combat state: it identifies the current target and its hit points, then explicitly reports no active target after removal.- Every
meleeandenemy_meleeTurnResultis routed to its actor view.ActorView.last_damagerecords the received amount and the sprite is tinted red to make the hit visible. HUD/EventLogkeeps appending all combat messages. The public E2E seam remainsGame.submit_test_action(Vector2i)and uses the same action processor as keyboard input.
Verification
GODOT_BIN=/snap/bin/godot4 ./scripts/test-unit.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/test-e2e.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/verify.sh
GODOT_BIN=/snap/bin/godot4 timeout 3s /snap/bin/godot4 --headless --path .
The focused presentation unit test plus resolver tests and the real-scene E2E cover hit feedback, counterattack feedback, HUD values/summary/log, and enemy removal.
Limits
This slice deliberately provides one compact map, one deterministic goblin, direct pursuit, no persistence, inventory, audio, or animations/tweens. Damage feedback remains a persistent tint/state rather than a timed animation.