My Pygame Game Engine
at main 390 B view raw
1## Imports 2 3import pygame, os 4pygame.mixer.init() 5 6## Class 7 8class Sound_Handler: 9 10 def __init__(self, game): 11 self.game = game 12 13 ## Loads sound from current active sound folder following the current Assetpack 14 15 def load(self, sound_file): 16 return pygame.mixer.Sound(os.path.join("src", "resources", self.game.current_assetpack, "assets", "sounds", sound_file)) 17