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))