Firing sound for catapult actually comes from the direction of the catapult. It still works if catapult itself is out of normal sound range.
This commit is contained in:
Submodule libstormgames updated: 2f791da5b7...e7d5b03e55
@@ -75,21 +75,21 @@ class Catapult(Object):
|
|||||||
def fire(self, currentTime, player):
|
def fire(self, currentTime, player):
|
||||||
"""Start the firing sequence"""
|
"""Start the firing sequence"""
|
||||||
self.lastFireTime = currentTime
|
self.lastFireTime = currentTime
|
||||||
|
|
||||||
# Play launch sound
|
# Play launch sound using directional audio
|
||||||
play_sound(self.sounds['catapult_launch'])
|
play_directional_sound(self.sounds, 'catapult_launch', player.xPos, self.xPos)
|
||||||
|
|
||||||
# Set up pending pumpkin
|
# Set up pending pumpkin
|
||||||
isHigh = random.choice([True, False])
|
isHigh = random.choice([True, False])
|
||||||
fireDirection = 1 if player.xPos > self.xPos else -1
|
fireDirection = 1 if player.xPos > self.xPos else -1
|
||||||
|
|
||||||
# Store pumpkin data for later creation
|
# Store pumpkin data for later creation
|
||||||
self.pendingPumpkin = {
|
self.pendingPumpkin = {
|
||||||
'isHigh': isHigh,
|
'isHigh': isHigh,
|
||||||
'direction': fireDirection,
|
'direction': fireDirection,
|
||||||
'playerMaxHealth': player.get_max_health()
|
'playerMaxHealth': player.get_max_health()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set when to actually launch the pumpkin
|
# Set when to actually launch the pumpkin
|
||||||
self.pumpkinLaunchTime = currentTime + self.launchDelay
|
self.pumpkinLaunchTime = currentTime + self.launchDelay
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user