-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (22 loc) · 897 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
31
32
from game import pg, Screen, InterfaceObject, GameEngine, MainMenu
from game.constants import gunity
from game.assets import maps
screen = Screen()
menu = MainMenu(screen)
config = menu.menu_loop()
while config['player_number'] != 0:
n = config['player_number']
players = config['players']
sprites = players['sprites']
controls = players['controls']
orientations = config['map']['orientations']
positions = config['map']['positions']
if n > 0:
background = pg.transform.scale(pg.image.load('assets/img/background.jpg'), (60 * gunity, 30 * gunity))
arena = InterfaceObject(screen, background)
game = GameEngine(screen,arena,config['map'])
for i in range(n):
game.add_player(sprites[i],orientations[i],*positions[i],controls[i])
winners = game.game_loop()
menu.ending_screen(winners)
del game