Fix downward dash not damaging enemies #26

Merged
tas merged 1 commits from fix/downward-dash-damage into main 2026-03-16 20:20:28 +00:00
Collaborator

Summary

Fixes #15 — the downward dash (double-tap down) did not hurt enemies and left the player vulnerable immediately after.

Root cause: The stomp check in level.c was inside the !(player->flags & ENTITY_INVINCIBLE) guard. Since the downward dash grants invincibility, the entire collision block was skipped — no stomp damage could ever be dealt during a dash.

Changes:

  • level.c: Move invincibility guard to only protect against taking damage, not dealing it. Stomping now works regardless of invincibility state.
  • player.c / player.h: Extend dash invincibility by PLAYER_DASH_INV_GRACE (0.15s) past the dash duration, giving a brief safety window after landing.
## Summary Fixes #15 — the downward dash (double-tap down) did not hurt enemies and left the player vulnerable immediately after. **Root cause:** The stomp check in `level.c` was inside the `!(player->flags & ENTITY_INVINCIBLE)` guard. Since the downward dash grants invincibility, the entire collision block was skipped — no stomp damage could ever be dealt during a dash. **Changes:** - **`level.c`**: Move invincibility guard to only protect against *taking* damage, not *dealing* it. Stomping now works regardless of invincibility state. - **`player.c` / `player.h`**: Extend dash invincibility by `PLAYER_DASH_INV_GRACE` (0.15s) past the dash duration, giving a brief safety window after landing.
tas added 1 commit 2026-03-16 20:20:07 +00:00
Fix downward dash not damaging enemies and add post-dash invincibility
Some checks failed
CI / build (pull_request) Successful in 32s
Deploy / deploy (push) Failing after 1m17s
66a7b9e7e6
Stomping was guarded by the invincibility check, so during a downward
dash the player could never deal stomp damage. Move the invincibility
guard to only protect against taking damage, not dealing it.

Extend dash invincibility by PLAYER_DASH_INV_GRACE (0.15s) past the
dash duration so the player is briefly protected after landing.

Closes #15
tas force-pushed fix/downward-dash-damage from aa2550cc59 to 66a7b9e7e6 2026-03-16 20:20:08 +00:00 Compare
tas merged commit 66a7b9e7e6 into main 2026-03-16 20:20:28 +00:00
tas deleted branch fix/downward-dash-damage 2026-03-16 20:20:29 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tas/major_tom#26