Finally got it, I think. The path to the end.ogg file was constructed differently from other sounds loaded by libstormgames. Because the libstormgames version works, just use it here too.

This commit is contained in:
Storm Dragon
2025-09-13 14:44:19 -04:00
parent 8218d28701
commit 4041983385

View File

@@ -445,10 +445,9 @@ class WickedQuest:
# Game complete - use gameStartTime for total
totalTime = pygame.time.get_ticks() - self.gameStartTime
if self.player.xPos >= self.currentLevel.rightBoundary:
# Check for end of game scene
gamePath = get_game_dir_path(self.currentGame)
# Check for end of game scene using relative path like other sounds
for ext in ['.wav', '.ogg', '.mp3']:
endFile = os.path.join(gamePath, f'end{ext}')
endFile = os.path.join("levels", self.currentGame, f'end{ext}')
if os.path.exists(endFile):
self.get_sounds()['end_scene'] = pygame.mixer.Sound(endFile)
cut_scene(self.get_sounds(), 'end_scene')