diff --git a/__init__.py b/__init__.py index a3e63b8..6664f8e 100755 --- a/__init__.py +++ b/__init__.py @@ -681,13 +681,24 @@ def cut_scene(sounds, soundName): """ pygame.event.clear() pygame.mixer.stop() + + # Get the reserved channel (0) for cut scenes channel = pygame.mixer.Channel(0) + + # Apply the appropriate volume settings + # Use sfxVolume since cut scenes are sound effects + # Multiply by masterVolume for global volume control + channel.set_volume(sfxVolume * masterVolume, sfxVolume * masterVolume) + + # Play the sound channel.play(sounds[soundName]) + while pygame.mixer.get_busy(): - event = pygame.event.poll() - if event.type == pygame.KEYDOWN and event.key in [pygame.K_ESCAPE, pygame.K_RETURN, pygame.K_SPACE]: - pygame.mixer.stop() - pygame.event.pump() + for event in pygame.event.get(): + if event.type == pygame.KEYDOWN and event.key in [pygame.K_ESCAPE, pygame.K_RETURN, pygame.K_SPACE]: + pygame.mixer.stop() + return + pygame.time.delay(10) def play_random_falling(sounds, soundName, player_x, object_x, start_y, currentY=0, max_y=20, existing_channel=None):