Base infrastructure for scenes.
authorSimon Cross <hodgestar@gmail.com>
Sun, 28 Feb 2016 16:12:00 +0000 (18:12 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sun, 28 Feb 2016 16:12:00 +0000 (18:12 +0200)
koperkapel/pgzapp.py
koperkapel/scenes/__init__.py [new file with mode: 0644]
koperkapel/scenes/base.py [new file with mode: 0644]
koperkapel/scenes/menu.py [new file with mode: 0644]

index 225dde95c2f310ef5502df505dea3edc0b3b18d4..d703aaf16bc37a6d040fd58801f0a711217773ef 100644 (file)
@@ -3,3 +3,15 @@
 TITLE = "Koperkapel"
 WIDTH = 1024
 HEIGHT = 768
+
+from .scenes import menu
+
+current_scene = menu.MenuScene()
+
+
+def update(dt):
+    current_scene.update(dt)
+
+
+def draw():
+    current_scene.draw(screen)
diff --git a/koperkapel/scenes/__init__.py b/koperkapel/scenes/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/koperkapel/scenes/base.py b/koperkapel/scenes/base.py
new file mode 100644 (file)
index 0000000..6bb7f55
--- /dev/null
@@ -0,0 +1,11 @@
+""" Scene utilities. """
+
+
+class Scene:
+    """ Base class for scenes. """
+
+    def update(self, dt):
+        pass
+
+    def draw(self, screen):
+        pass
diff --git a/koperkapel/scenes/menu.py b/koperkapel/scenes/menu.py
new file mode 100644 (file)
index 0000000..b646be0
--- /dev/null
@@ -0,0 +1,10 @@
+""" Mani menu scene. """
+
+from .base import Scene
+
+
+class MenuScene(Scene):
+    """ Main menu scene. """
+
+    def draw(self, screen):
+        screen.draw.text("Main menu", (300, 300))