Add displaying of a simple window.
[tabakrolletjie.git] / tabakrolletjie / engine.py
1 """ Engine for moving controll scenes and tranistions between them.
2 """
3
4 import pygame.display
5 import pygame.event
6 import pygame.time
7
8 import pygame.locals as pgl
9
10 from .constants import FPS
11
12
13 class Engine(object):
14     def __init__(self, screen, scene):
15         self._screen = screen
16         self._scene = scene
17
18     def run(self):
19         clock = pygame.time.Clock()
20
21         while True:
22             events = pygame.event.get()
23             for ev in events:
24                 if ev.type == pgl.QUIT:
25                     return
26                 else:
27                     pass  # TODO: send to scene
28
29             # TODO: render scene
30             pygame.display.flip()
31
32             clock.tick(FPS)