forked from Anand1310/summer-code-jam-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (27 loc) · 736 Bytes
/
main.py
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
import sys
from typing import List
from openal import oalQuit
from core.sound import play_start_bgm
from game import Game, Scene
from levels import (
EndScene, InfiniteLevel, Level, credit_scene, leaderboard_menu, pause_menu,
title_scene
)
if __name__ == "__main__":
play_start_bgm()
scenes: List[Scene] = [title_scene]
if len(sys.argv) == 1:
scenes.extend([Level(str(i)) for i in range(1, 9)])
else:
scenes.append(Level(sys.argv[1]))
game = Game(
scenes,
pause=pause_menu,
infinite=InfiniteLevel(True),
leaderboard=leaderboard_menu,
tutorial=Level("0"),
end_scene=EndScene(),
credit=credit_scene,
)
game.run()
oalQuit()