Fix placement of left/right spikes

This commit is contained in:
2026-07-26 19:04:54 -04:00
parent 8e077ff09d
commit d30b491ba7

View File

@@ -374,8 +374,8 @@ class Spike(Trap):
if dy == 1: # down (ceiling spike) if dy == 1: # down (ceiling spike)
return pygame.Rect(r.x, r.y, t, t // 2) return pygame.Rect(r.x, r.y, t, t // 2)
if dx == -1: # left (from right wall pointing left) if dx == -1: # left (from right wall pointing left)
return pygame.Rect(r.x, r.y, t // 2, t) return pygame.Rect(r.x + t // 2, r.y, t // 2, t)
return pygame.Rect(r.x + t // 2, r.y, t // 2, t) # right return pygame.Rect(r.x, r.y, t // 2, t) # right
# CCW rotation to point the (up-facing) sprite the right way. # CCW rotation to point the (up-facing) sprite the right way.
_ANGLE = {"up": 0, "left": 90, "down": 180, "right": -90} _ANGLE = {"up": 0, "left": 90, "down": 180, "right": -90}