-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameManager.py
47 lines (34 loc) · 1.24 KB
/
gameManager.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from homePage import *
from freeplay import *
from game import *
class GameManager():
def __init__(self, result="homepage"):
self.result = result
self.use_result()
def launch_homepage(self):
self.page = Homepage()
self.result = self.page.run()
self.use_result()
def launch_freeplay(self):
self.page = Freeplay()
self.result = self.page.run()
self.use_result()
def launch_2players(self, fps, maps):
self.page = Game(fps, maps, 2)
self.result = self.page.run()
self.use_result()
def launch_game(self, fps, maps):
self.page = Game(fps, maps)
self.result = self.page.run()
self.use_result()
def use_result(self):
if self.result is None:
return
if self.result[0] == "homepage" or self.result == "homepage":
self.launch_homepage()
elif self.result[0] == "freeplay" or self.result == "freeplay":
self.launch_freeplay()
elif self.result[0] == "2players" or self.result == "2players":
self.launch_2players(self.result[1], self.result[2])
elif self.result[0] == "game":
self.launch_game(self.result[1], self.result[2])