Oops, accidentally removed the obj_update function.
This commit is contained in:
parent
2df86c9c76
commit
80fe2caff3
13
__init__.py
13
__init__.py
@ -332,9 +332,20 @@ def obj_play(sounds, soundName, player_pos, obj_pos, loop=True):
|
||||
if x:
|
||||
x.set_volume(volume * left, volume * right)
|
||||
return x
|
||||
|
||||
def obj_update(x, player_pos, obj_pos):
|
||||
if x is None:
|
||||
return None
|
||||
volume, left, right = calculate_volume_and_pan(player_pos, obj_pos)
|
||||
if volume == 0:
|
||||
x.stop()
|
||||
return None
|
||||
# Apply the volume and pan
|
||||
x.set_volume(volume * left, volume * right)
|
||||
return x
|
||||
|
||||
def obj_stop(x):
|
||||
"""Tries to stop a playing object channel"""
|
||||
# Tries to stop a playing object channel
|
||||
try:
|
||||
x.stop()
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user