From d456b8b3b3debf4fd2b9173a9c64d0c28c8c9268 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 9 Sep 2020 20:41:41 -0400 Subject: [PATCH] Fixed a couple bugs on the object positioning code. --- libstormgames.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstormgames.py b/libstormgames.py index f9887ad..737ba74 100755 --- a/libstormgames.py +++ b/libstormgames.py @@ -177,6 +177,7 @@ def obj_play(sounds, soundName, playerPos, objPos): if playerPos - objPos > 9 or playerPos - objPos < -9: # The sound is out of range, so do nothing. return + 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)) @@ -196,6 +197,7 @@ def obj_update(x, playerPos, objPos): if playerPos - objPos > 9 or playerPos - objPos < -9: obj_stop(x) return + 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))