Skip to content

feat(dungeon): boss-fight HUD bar - #32

Merged
silver-snoopy merged 10 commits into
mainfrom
feat/boss-hud
May 30, 2026
Merged

feat(dungeon): boss-fight HUD bar#32
silver-snoopy merged 10 commits into
mainfrom
feat/boss-hud

Conversation

@silver-snoopy

Copy link
Copy Markdown
Owner

What

Gathers the loose top of the boss fight into a single themed HUD bar: back-to-menu door + Floor N/M · <domain> on the left, icon-only SFX/BGM on the right, and the boss name moved just below it.

Design · Plan.

How

  • src/ui/bossHud.ts — pure, unit-tested darken(color, factor) + formatRunLabel(campaign, domainShort), and a composer mountBossHud(scene, {boss, campaign, onExit, onBgmToggle}) that draws the bar (darkened environmentColor + subtle border) and reuses mountMenuButton (door) + mountAudioToggles (icon-only).
  • src/ui/audioToggles.ts — new iconOnly + y options; the Hub keeps its labeled toggles (passes no iconOnly), so mute/persistence behavior is byte-for-byte unchanged.
  • src/ui/inFightNav.tsmountMenuButton gained an optional position.
  • src/types.ts + src/config.tsdomainShort on each boss (Agentic / Claude Code / Prompting / MCP / Context).
  • src/scenes/BossFightScene.ts — one mountBossHud(...) call replaces the two separate mounts; boss name y 30 → 66.

Floor = floorsCleared+1 / bossOrder.length; isolated/debug fights (no campaign) gracefully show just the domain.

Tests / checks

  • npx vitest run127 passing (incl. 7 new: darken, formatRunLabel with/without campaign, and a domainShort-on-every-boss guard).
  • tsc --noEmit clean · npm run build clean · root npm run lint (Biome) clean.
  • Final review: no Critical/Important issues (audio behavior unchanged, depths/coords sound, floor label matches the on-screen boss, no unused imports).

Manual verification (interactive — not automatable in CI)

At localhost:5173 in a real run, enter a boss fight and confirm:

  • Themed bar spans the top; door + Floor 1/5 · <domain> left, icon-only 🔊/🎵 right
  • Audio icons still mute and persist across reload; Hub toggles still show labels
  • Boss name sits just below the bar, no overlap with bar or question bubble
  • Beat a boss → floor number increments next fight
  • ?demo shows the bar; a debug-isolated boss shows just the domain (no "Floor"), no crash
  • Check 2+ bosses for color cohesion (tune BAR_DARKEN if too dark)

🤖 Generated with Claude Code

Daniel Sallai and others added 9 commits May 30, 2026 22:50
Top strip: themed (darkened boss color) bar holding door + "Floor N/5 · domain"
left and icon-only SFX/BGM right; boss name moves below. New bossHud composer +
pure darken/formatRunLabel seams; domainShort added to boss config.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 tasks: darken+formatRunLabel helpers (TDD), domainShort on bosses, audio
iconOnly option, mountMenuButton position, mountBossHud composer, BossFightScene
wiring + manual verify.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
From /pr-review-toolkit:review-pr:
- domainShort is now a DomainShort union (closed set of 5) — typos become
  compile errors instead of silent bad labels.
- HUD's campaign subset is Pick<Campaign,'floorsCleared'|'bossOrder'> via a
  type-only import (de-duped, drift-protected) instead of an inline literal.
- Named BAR_BORDER_DARKEN constant for the border factor.
- Fixed stale "top-left" doc on mountMenuButton (HUD repositions it); clarified
  iconOnly re-anchors layout; dropped the rot-prone "y 0–44" literal comment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ants

- Boss name moves off the scene body into the HUD bar (amber, centered between
  the run label and audio cluster); the old top-center banner floated on the
  brick wall and clipped the question scroll.
- Hero/boss clusters (sprite + HP + name/taunt) shifted outward (x 120/840 →
  85/875) for breathing room around the central scroll; taunt wrap trimmed so
  it stays on-canvas at the new position.
- Boss scaled up (4 → 6) for presence and grounded on the hero's floor line, so
  it looms ~2× the hero instead of reading as the same size.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@silver-snoopy
silver-snoopy merged commit 23c44f5 into main May 30, 2026
1 check passed
@silver-snoopy
silver-snoopy deleted the feat/boss-hud branch May 30, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant