Allow player to be pushed off moving blocks

This commit is contained in:
James Campbell
2026-07-25 13:13:48 -04:00
parent 3ad36d2911
commit 8e077ff09d
6 changed files with 75 additions and 13 deletions

View File

@@ -127,14 +127,12 @@ class Player:
if dx < 0 and bl and r.colliderect(right): # pushed left into a wall
return True
# Riding a platform that carries us *sideways* into a wall: the pushing
# block is under our feet, so the side-probes above miss it — use the
# carry direction instead. (Vertical carry crushes are caught above.)
cdx, _ = self.carry
if cdx > 0 and br:
return True
if cdx < 0 and bl:
return True
# A platform that carries us *sideways* into a wall is NOT a crush: the
# carrier is under our feet, perpendicular to the wall, so it can't pinch
# us against it. The X pass simply stops us at the wall edge while the
# platform keeps sliding underneath. (A genuine horizontal crush — a
# mover closing on our side against a backing wall — is the dx cases
# above. Vertical carry crushes are the dy cases above.)
return False
def _ride_platforms(self):