Attempt to fix object positioning.

This commit is contained in:
Storm Dragon 2020-09-10 02:51:33 -04:00
parent b897abf0a3
commit 84a722bb8e

View File

@ -179,8 +179,8 @@ def obj_play(sounds, soundName, playerPos, objPos):
return None return None
distance = playerPos - objPos distance = playerPos - objPos
angle = math.radians(distance * 5) angle = math.radians(distance * 5)
left = 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)) right = math.sqrt(2)/2.0 * (math.cos(angle) - math.sin(angle))
if left < 0: if left < 0:
left *= -1 left *= -1
if right < 0: if right < 0:
@ -199,8 +199,8 @@ def obj_update(x, playerPos, objPos):
return None return None
distance = playerPos - objPos distance = playerPos - objPos
angle = math.radians(distance * 5) angle = math.radians(distance * 5)
left = 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)) right = math.sqrt(2)/2.0 * (math.cos(angle) - math.sin(angle))
if left < 0: if left < 0:
left *= -1 left *= -1
if right < 0: if right < 0:
@ -318,6 +318,7 @@ def learn_sounds(sounds):
def game_menu(sounds, *options): def game_menu(sounds, *options):
loop = True loop = True
pygame.mixer.stop()
if pygame.mixer.music.get_busy(): if pygame.mixer.music.get_busy():
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
else: else: