v1.2: Log zeigt gewaehlte Sequenz (nie zweimal dieselbe), Anleitung vor Moduswahl (jede Runde), Roll-Sound-Kanal reserviert (Fix kein Sound), frueheres Abbremsen + Snap-Fenster 160px, 10s Cooldown am Ende, Sprueche nach Prozent (sayings.py), 56 Tests.

This commit is contained in:
Project Bridge committed 2026-11-01 11:38:16 +00:00
1 parent d970185e75
commit e3a0c5a57d
11 files changed
+319 -37

No files matched your search

+25 -4
View File
@@ -101,12 +101,16 @@ def main(argv: list[str] | None = None) -> int:
for line in controller_hint_lines():
print(line)
print(assets.audio_info())
sequences, warnings = load_sequences()
for warning in warnings:
print("Sequenz-Warnung:", warning, file=sys.stderr)
rng = random.Random(args.seed)
difficulty: Difficulty = DEFAULT_DIFFICULTY
round_number = 0
previous_sequence: int | None = None
phase = Phase.INTRO
after_intro = Phase.MENU # nach dem Tutorial kommt die Stufenauswahl
@@ -142,19 +146,36 @@ def main(argv: list[str] | None = None) -> int:
if result is HandleResult.QUIT:
return False
if result is HandleResult.NEW_ROUND:
menu = DifficultyMenu(assets, selected=difficulty)
phase = Phase.MENU
# Wie beim Programmstart: Anleitung -> Stufenauswahl -> Ampel
intro = Intro(assets, show_instruction=True)
after_intro = Phase.MENU
menu = None
phase = Phase.INTRO
return True
def advance(dt: float) -> None:
"""Weiterrechnen und Phasenwechsel ohne Eingabe."""
nonlocal phase, intro, menu, game
nonlocal phase, intro, menu, game, round_number, previous_sequence
if phase is Phase.INTRO and intro is not None:
if intro.update(dt):
intro = None
if after_intro is Phase.PLAY:
game = Game(assets, sequences, difficulty=difficulty, rng=rng)
game = Game(
assets,
sequences,
difficulty=difficulty,
rng=rng,
previous_sequence=previous_sequence,
)
previous_sequence = game.sequence_index
round_number += 1
start = ", ".join(spec.label for spec in game.sequence[:5])
print(
f"Runde {round_number}: Sequenz {game.sequence_index + 1}/{len(sequences)} "
f"({len(game.sequence)} Koffer, Start: {start} …), "
f"Stufe {difficulty.label}"
)
else:
menu = DifficultyMenu(assets, selected=difficulty)
phase = after_intro