-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (21 loc) · 579 Bytes
/
main.py
File metadata and controls
29 lines (21 loc) · 579 Bytes
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
import pgzrun
from controllers.game_controller import GameController
from utils.constants import SCREEN
WIDTH = SCREEN["WIDTH"]
HEIGHT = SCREEN["HEIGHT"]
controller = GameController()
mouse_pos = (0, 0)
def draw():
controller.draw(screen)
if controller.game_state.state == "menu":
controller.views["menu"].update(mouse_pos)
def update(dt):
controller.update(dt)
def on_mouse_down(pos):
controller.on_mouse_down(pos)
def on_mouse_move(pos):
global mouse_pos
mouse_pos = pos
def on_key_down(key):
controller.on_key_down(key)
pgzrun.go()