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:
@@ -75,21 +75,21 @@ class Catapult(Object):
|
||||
def fire(self, currentTime, player):
|
||||
"""Start the firing sequence"""
|
||||
self.lastFireTime = currentTime
|
||||
|
||||
# Play launch sound
|
||||
play_sound(self.sounds['catapult_launch'])
|
||||
|
||||
|
||||
# Play launch sound using directional audio
|
||||
play_directional_sound(self.sounds, 'catapult_launch', player.xPos, self.xPos)
|
||||
|
||||
# Set up pending pumpkin
|
||||
isHigh = random.choice([True, False])
|
||||
fireDirection = 1 if player.xPos > self.xPos else -1
|
||||
|
||||
|
||||
# Store pumpkin data for later creation
|
||||
self.pendingPumpkin = {
|
||||
'isHigh': isHigh,
|
||||
'direction': fireDirection,
|
||||
'playerMaxHealth': player.get_max_health()
|
||||
}
|
||||
|
||||
|
||||
# Set when to actually launch the pumpkin
|
||||
self.pumpkinLaunchTime = currentTime + self.launchDelay
|
||||
|
||||
|
Reference in New Issue
Block a user