-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (27 loc) 路 1.04 KB
/
Copy pathmain.py
File metadata and controls
36 lines (27 loc) 路 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import pygame
from game.game import Game
from game.utils.sound_manager import SoundManager
def main() -> None:
# Initialize pygame
pygame.init()
# Create a SoundManager instance
sound_manager = SoundManager()
# Preload all necessary sound effects for the game
sound_manager.load_sounds()
# Create a Game instance
game_instance = Game(sound_manager)
# Call the setup function of Game instance
game_instance.setup()
# Main game loop
running = True
while running:
# Execute game_loop() from Game instance
running = game_instance.game_loop()
# Interspersed sound controls
# Example of sound event calls (Assuming these are implemented appropriately in the game's architecture)
# sound_manager.play_sound(SoundManager.MOVE_SOUND)
# sound_manager.play_sound(SoundManager.SHOOT_SOUND)
# sound_manager.play_sound(SoundManager.BGM_SOUND)
# sound_manager.play_sound(SoundManager.EXPLOSION_SOUND)
if __name__ == "__main__":
main()