diff --git a/game/level.py b/game/level.py index 123da4f..2485c81 100644 --- a/game/level.py +++ b/game/level.py @@ -446,12 +446,15 @@ class Player: # auf Kopfhoehe -- endgueltige Verifikation per DOSBox steht aus). head_ty = int((self.y - self.HITBOX_H) // TILE) tx = int(self.x // TILE) + head_ct = level.ctype(tx, head_ty) if (self.can_hang and not self.hanging and not self.on_ground - and keys[pygame.K_UP] and level.ctype(tx, head_ty) & 8): + and keys[pygame.K_UP] + and head_ct & 8 and not head_ct & SOLID_BIT): self.hanging = True self.y = head_ty * TILE + TILE + self.HITBOX_H - 0.01 if self.hanging: - if (not level.ctype(tx, head_ty) & 8 or keys[pygame.K_DOWN] + hc = level.ctype(tx, head_ty) + if (not (hc & 8 and not hc & SOLID_BIT) or keys[pygame.K_DOWN] or self.on_ground): self.hanging = False else: