game_pos should be a tuple.
[koperkapel.git] / koperkapel / pgzapp.py
1 """ Pygame-zero application module. """
2
3 import sys
4
5 from .world import World
6 from .scenes.base import Engine
7 from .scenes.menu import MenuScene
8 from .constants import WIDTH, HEIGHT, TITLE
9
10
11 engine = Engine(sys.modules[__name__], MenuScene(), World())
12
13
14 def update(dt):
15     engine.update(dt)
16
17
18 def draw():
19     engine.draw()
20
21
22 def on_mouse_down(pos, button):
23     engine.on_mouse_down(pos, button)
24
25
26 def on_mouse_up(pos, button):
27     engine.on_mouse_up(pos, button)
28
29
30 # NOTE: on_mouse_move is not hooked up because of
31 #       https://bitbucket.org/lordmauve/pgzero/issues/41/
32 #       spellchecker-has-wrong-argument-names-for
33
34
35 def on_key_down(key, mod, unicode):
36     engine.on_key_down(key, mod, unicode)
37
38
39 def on_key_up(key, mod):
40     engine.on_key_up(key, mod)
41
42
43 def on_music_end():
44     engine.on_music_end()