more turnip
[tabakrolletjie.git] / tabakrolletjie / engine.py
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..eee88b761dcc168c07c1d8fe85731af1b00a7962 100644 (file)
@@ -0,0 +1,32 @@
+""" Engine for moving controll scenes and tranistions between them.
+"""
+
+import pygame.display
+import pygame.event
+import pygame.time
+
+import pygame.locals as pgl
+
+from .constants import FPS
+
+
+class Engine(object):
+    def __init__(self, screen, scene):
+        self._screen = screen
+        self._scene = scene
+
+    def run(self):
+        clock = pygame.time.Clock()
+
+        while True:
+            events = pygame.event.get()
+            for ev in events:
+                if ev.type == pgl.QUIT:
+                    return
+                else:
+                    pass  # TODO: send to scene
+
+            # TODO: render scene
+            pygame.display.flip()
+
+            clock.tick(FPS)