Skip to content

Better geometrical slope handling#2

Closed
Ishanarunarjpriya wants to merge 28 commits into
mainfrom
better-geometrical-slope-handling
Closed

Better geometrical slope handling#2
Ishanarunarjpriya wants to merge 28 commits into
mainfrom
better-geometrical-slope-handling

Conversation

@Ishanarunarjpriya

Copy link
Copy Markdown
Owner

No description provided.

genizy and others added 28 commits May 1, 2026 14:29
Vehicle modes (isFlying/isShip/isWave/isBird/isDart) must not
accumulate slope state — isOnSlope, wasOnSlope, currentSlopeAngle,
and slopeVelocity are wiped to 0 before any slope hit results are
applied. This prevents the polluting flags from contaminating
collision tracking on the next frame, which was causing unexpected
player deaths every time a ship/wave/bird/dart-mode touched ground
after a slope run.
1. Hazard sorting priority (player.js:2034–2048)
   Moved _colType === hazardType to the absolute first branch inside
   _broadPhaseHit so no earlier portal/coin/ring handler 'continue'
   can skip a death check. Old duplicate block removed from mid-chain.

2. Ball velocity symmetric clamp (player.js:1850)
   Replaced asymmetric if/else clamped at +/-30 for gravityFlipped
   only with a single Math.max(-30, Math.min(30, velocity)) that
   constrains both branches identically, preventing pad-launched
   balls from entering out-of-bounds clipping bands.

3. QueuedHold release safety (player.js:1812)
   Added this.p.queuedHold = false inside the _updateFlyJump
   flight path whenever this.p.upKeyDown reads false and the player
   is not yet falling, so jump-ring buffered input never fires on
   a key release frame.
Insert vehicle override (isFlying/isShip/isWave/isBird/isDart) directly
inside the slope detection loop, immediately after _floorSlopeHit and
_ceilingSlopeHit assignment. This gives the override access to local
variables (_surfY, _playerRadOnSlope) and lets it continue past the
slope processing. Overrides resolve position, set ground state, wipe
slope flags, and nullify the hit object so the post-loop block is
skipped for these modes.
- Wave/dart now slide on slopes instead of dying (matching decompiled GD behavior)
- Inside-slope death now checks mode type instead of objid restriction
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