-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
48 lines (41 loc) · 1.18 KB
/
Copy pathmain.py
File metadata and controls
48 lines (41 loc) · 1.18 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
37
38
39
40
41
42
43
44
45
46
47
48
import pygame
import sys
from GameState import *
from MapLoader import *
from UserInterface import *
mapAbout = MapAbout()
mapMainMenu = MapMainMenu()
map1 = Map1()
map2 = Map2()
map3 = Map3()
map4 = Map4()
map5 = Map5()
map6 = Map6()
map7 = Map7()
map8 = Map8()
map9 = Map9()
map10 = Map10()
map11 = Map11()
choices = [mapMainMenu, map1, map2, map3, map4, map5, map6, map7, map8, map9, map10, map11, mapAbout]
running = True
while running:
pygame.init()
ui = UserInterface(mapMainMenu)
ui.run()
mapChoice = 0
if ui.check_win_state():
for unit in ui._gameState.units:
if unit.is_control():
for flag in ui._gameState.units:
if flag.location == unit.location:
if flag != unit and flag.id != "quit" and flag.id != "mapAbout":
mapChoice = int(flag.id.split("map")[1])
elif flag.id == "quit":
running = False
elif flag.id == "mapAbout":
mapChoice = 12
if not running:
break
ui = UserInterface(choices[mapChoice])
ui.run()
pygame.quit()