diff --git a/.idea/misc.xml b/.idea/misc.xml index 060d2c5..db8786c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/images/tutorial.png b/images/tutorial.png index 7874b83..fff9c28 100644 Binary files a/images/tutorial.png and b/images/tutorial.png differ diff --git a/main.py b/main.py index 5b5eb5b..31cb110 100644 --- a/main.py +++ b/main.py @@ -439,6 +439,8 @@ async def show_instruction_screen(image): async def fail_current_case(): global can_use_tilt, can_use_on_top, game_finished, shake_timer + if sound_fail: + sound_fail.play() await current_case.fail_snap() if current_case.x + current_case.width > TRAILER_X + TRAILER_WIDTH: if stacked_cases and stacked_cases[-1] == current_case: @@ -447,8 +449,6 @@ async def fail_current_case(): stacked_cases.append(current_case) can_use_tilt = True can_use_on_top = True - if sound_fail: - sound_fail.play() spawn_case_in_game() shake_timer = 10 @@ -500,6 +500,14 @@ async def show_game_over(score): except ImportError: js = None username = "Spieler" + + try: + query = js.window.location.search + params = urllib.parse.parse_qs(query[1:]) + username = params.get("name", ["Spieler"])[0] + except Exception: + pass + data = { "name": username, "score": int(score), @@ -515,14 +523,6 @@ async def show_game_over(score): if not is_browser() or js is None: return - - try: - query = js.window.location.search - params = urllib.parse.parse_qs(query[1:]) - username = params.get("name", ["Spieler"])[0] - except Exception: - pass - try: form = js.document.createElement("form") form.method = "POST"