-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui_main.py
More file actions
35 lines (28 loc) · 1.01 KB
/
gui_main.py
File metadata and controls
35 lines (28 loc) · 1.01 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
#
import sys
import config
from Gui.gui_controller import GuiController
from Gui.gui_field import GuiField
from Model.ball_generator import BallGenerator
from Model.game_field import GameField
from Model.score_board import ScoreBoard
from utils import create_parser
try:
from PyQt5 import QtGui, QtCore, QtWidgets
except Exception as e:
sys.stderr.write('PyQt5 not found: "{}"'.format(e).encode())
sys.exit(config.QT_NOT_FOUND)
if __name__ == '__main__':
parser = create_parser()
app = QtWidgets.QApplication(sys.argv)
game_field = GameField(parser.size)
controller = GuiController(
game_field,
ScoreBoard.load_from(parser.records, parser.hint_mode),
parser.debug)
BallGenerator.place_balls(GameField(parser.size),
controller,
BallGenerator.generate_balls(10, parser.debug,
False))
ex = GuiField(game_field, controller)
sys.exit(app.exec_())