Skip to content

M5.2: game feel - #35

Merged
hynding merged 1 commit into
mainfrom
claude/m5.2-game-feel
Nov 21, 2026
Merged

hynding merged 1 commit into
mainfrom
claude/m5.2-game-feel

Conversation

@hynding

@hynding hynding commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Requested by Steve · project thread

Stacked on #34 (M5.1). Merge that first.

What's new

Every landed hit now has impact, and each effect can be tuned or switched off in a new settings.feel section (Settings → Feel in the Forge):

  • Hit-stop: the whole fight holds for a moment. The length is base + perDamage × damage, capped at max. The sim loop and physics both pause, so nothing drifts and the fight carries on exactly where it was.
  • Screen shake: scaled the same way and dies away at decay per second. The camera and its target move together, so the view jolts without tilting.
  • Hit sparks: a burst where the hit lands, in another colour when the hit is guarded.
  • Dust: a puff at the target's feet on knockdowns and KOs.
  • Damage numbers: float up from the target, white for enemies and red for the player. They're drawn as HTML labels, so no font download is needed.

Where the code is

  • src/sim/feel.ts: the pure logic (feelHit, stepFeel, shakeOffset, sparkDirections), with tests.
  • SimLoopDriver: owns the scene's feel state and does the hit-stop.
  • ScenePhysics: pauses physics while the game is frozen and during a hit-stop.
  • Effects.tsx: draws the effects.
  • CombatSystem: calls feelHit for every hit.

Checks

  • lint, typecheck, 357 tests and the build all pass.
  • DEFAULT_CONFIG snapshot updated on purpose; the only addition is feel.
  • feel.test.ts covers:
    • scaling and caps;
    • every effect off means nothing happens;
    • the strongest hold and shake win;
    • decay and clean-up;
    • which effects a hit, a guarded hit and a knockdown produce.
  • Headless play of level 1: damage numbers and sparks appear on hits (screenshot checked). The fight continues through hit-stops: a KO scored, the next wave arrived, and there were no page errors.

Generated by Claude Code

Hit-stop, screen shake, hit sparks (another colour when guarded), dust
on knockdowns and KOs, and floating damage numbers, each tuned and
switchable in a new settings.feel section. A hit-stop holds both the sim
loop and physics, so the fight resumes exactly where it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017AxU91KfohopVBJiiV9gwj
@hynding hynding self-assigned this Nov 21, 2026
@hynding
hynding changed the base branch from claude/m5.1-audio to main November 21, 2026 04:45
@hynding
hynding merged commit 0b7c057 into main Nov 21, 2026
1 check passed
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.

2 participants