From 1b0a6eba834691676ba7a2e4b5a08203e9c236a5 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 24 Feb 2025 14:55:07 -0500 Subject: [PATCH] Firing sound for catapult actually comes from the direction of the catapult. It still works if catapult itself is out of normal sound range. --- libstormgames | 2 +- src/catapult.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libstormgames b/libstormgames index 2f791da..e7d5b03 160000 --- a/libstormgames +++ b/libstormgames @@ -1 +1 @@ -Subproject commit 2f791da5b75c34070987ddf3a4bdbb4ea0eac785 +Subproject commit e7d5b03e554501fc49b077468e1b09200dad4c41 diff --git a/src/catapult.py b/src/catapult.py index 86910ad..69aea38 100644 --- a/src/catapult.py +++ b/src/catapult.py @@ -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