Sterbe-Drops auf Slots 20/21 korrigiert (rotes Tuch/oranges Cappy statt lila 48/49) + Leertasten-Leak nach Tuer-Menue per jump_lock gefixt

This commit is contained in:
2026-07-26 02:33:26 +02:00
parent 6847f9be8c
commit ea644d094c
2 changed files with 26 additions and 1 deletions
+15 -1
View File
@@ -89,7 +89,10 @@ SLOT_SWIM_IDLE = 25 # Treiben im Wasser (erster Schwimm-Frame; 22-24 sind
# die "Schachtel essen"-Posen der Idle-Warteanimation)
SLOT_GLIDE = 34 # Toucan: Gleiten (Tabelle [4][34,34,34], Flag 0x20)
SLOT_PEEK = 45 # In-die-Tuer-gucken (Einzelframe, alle Charaktere)
SLOT_DROP1, SLOT_DROP2 = 48, 49 # fallendes Accessoire beim Tod (16x16)
# Fallendes Accessoire beim Tod: die flachen 32x16-Frames (Tony: Halstuch
# BOB 40, Smacks: Cappy BOB 29 -- beide frueher von Stefan abgenommen).
# Die 16x16-Slots 48/49 sind es NICHT (lila Kloetzchen, Zweck noch unklar).
SLOT_DROP1, SLOT_DROP2 = 20, 21
# Animations-Tabellen (Original: [delay Ticks@70Hz][slots...]):
ANIM_WALK = [0, 1, 2, 3, 4, 5, 6, 7] # [4] -> 17.5 fps
@@ -272,6 +275,9 @@ class Player:
self.flap_t = 0.0 # Rest-Dauer der Fluegelschlag-Animation
self.gliding = False
self.hanging = False # Coco: haengt an einem Ast
self.jump_lock = False # Sprung gesperrt, bis Taste losgelassen
# (Leertaste aus dem Tuer-Menue "leckte"
# sonst als Sofortsprung ins Level)
self._grounded_before = False
self.set_character(char, pos)
@@ -356,6 +362,11 @@ class Player:
self._jump_was_down = jump_pressed
space_edge = keys[pygame.K_SPACE] and not getattr(self, '_space_was_down', False)
self._space_was_down = keys[pygame.K_SPACE]
if self.jump_lock:
if jump_pressed:
jump_pressed = jump_edge = space_edge = False
else:
self.jump_lock = False
if self.swimming:
wy = level.info.get('water_y')
near_surface = wy is not None and (self.y - wy) < 24
@@ -786,6 +797,9 @@ def run_level(clock, assets, audio_paths, map_name='W1L1'):
return 'quit'
if choice and choice != player.char:
player.set_character(choice)
# Bestaetigungs-Leertaste nicht als Sprung ins Level leaken
pygame.event.clear()
player.jump_lock = True
# Wasser-Schaden fuer Nicht-Schwimmer. Stefans Erinnerung ans
# Original: schon der ERSTE Wasserkontakt kostet ein Herz (+Blinken),