Files
DungeonCrawlerWorld/README.md
T
2026-10-01 08:34:19 -04:00

43 lines
2.5 KiB
Markdown

# 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
```bash
"${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
```bash
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_cells` sont affichées à pleine luminosité.
- Les cellules présentes seulement dans `GameState.explored_cells` restent 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/PlayerHealthLabel` and `HUD/EnemyHealthLabel` show current hit points; the latter reports `No active target` after the goblin is defeated.
- `HUD/CombatSummaryLabel` is the separate public combat state: it identifies the current target and its hit points, then explicitly reports no active target after removal.
- Every `melee` and `enemy_melee` `TurnResult` is routed to its actor view. `ActorView.last_damage` records the received amount and the sprite is tinted red to make the hit visible.
- `HUD/EventLog` keeps appending all combat messages. The public E2E seam remains `Game.submit_test_action(Vector2i)` and uses the same action processor as keyboard input.
## Verification
```bash
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.