Fixed a couple bugs on the object positioning code.

This commit is contained in:
Storm Dragon 2020-09-09 20:41:41 -04:00
parent c5c32943e2
commit d456b8b3b3

View File

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