Extra life added, fixed sounds to use the new functions for volume control Other various improvements.

This commit is contained in:
Storm Dragon
2025-02-04 07:12:12 -05:00
parent 4f7f5504d1
commit 883dafaac0
9 changed files with 61 additions and 34 deletions

View File

@@ -37,9 +37,7 @@ class Pumpkin:
# Calculate volume and pan for splat sound based on final position
volume, left, right = calculate_volume_and_pan(playerX, self.x)
if volume > 0: # Only play if within audible range
channel = sounds["pumpkin_splat"].play()
if channel:
channel.set_volume(volume * left, volume * right)
obj_play(sounds, 'pumpkin_splat', playerX, self.x, loop=False)
def check_collision(self, player):
"""Check if pumpkin hits player"""
@@ -78,7 +76,7 @@ class Catapult(Object):
self.lastFireTime = currentTime
# Play launch sound
self.sounds['catapult_launch'].play()
play_sound(self.sounds['catapult_launch'])
# Set up pending pumpkin
isHigh = random.choice([True, False])