From 84a722bb8ecb87ef703d0847e8866ede7a5b4da8 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 10 Sep 2020 02:51:33 -0400 Subject: [PATCH] Attempt to fix object positioning. --- libstormgames.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libstormgames.py b/libstormgames.py index 82d82ad..dcdd3f6 100755 --- a/libstormgames.py +++ b/libstormgames.py @@ -179,8 +179,8 @@ def obj_play(sounds, soundName, playerPos, objPos): return None distance = playerPos - objPos angle = math.radians(distance * 5) - left = math.sqrt(2)/2.0 * (math.cos(angle) - math.sin(angle)) - right = math.sqrt(2)/2.0 * (math.cos(angle) + math.sin(angle)) + left = math.sqrt(2)/2.0 * (math.cos(angle) + math.sin(angle)) + right = math.sqrt(2)/2.0 * (math.cos(angle) - math.sin(angle)) if left < 0: left *= -1 if right < 0: @@ -199,8 +199,8 @@ def obj_update(x, playerPos, objPos): return None distance = playerPos - objPos angle = math.radians(distance * 5) - left = math.sqrt(2)/2.0 * (math.cos(angle) - math.sin(angle)) - right = math.sqrt(2)/2.0 * (math.cos(angle) + math.sin(angle)) + left = math.sqrt(2)/2.0 * (math.cos(angle) + math.sin(angle)) + right = math.sqrt(2)/2.0 * (math.cos(angle) - math.sin(angle)) if left < 0: left *= -1 if right < 0: @@ -318,6 +318,7 @@ def learn_sounds(sounds): def game_menu(sounds, *options): loop = True + pygame.mixer.stop() if pygame.mixer.music.get_busy(): pygame.mixer.music.unpause() else: