Skeleton for roach management scene.
authorSimon Cross <hodgestar@gmail.com>
Wed, 2 Mar 2016 14:54:10 +0000 (16:54 +0200)
committerSimon Cross <hodgestar@gmail.com>
Wed, 2 Mar 2016 14:54:10 +0000 (16:54 +0200)
koperkapel/scenes/menu.py
koperkapel/scenes/roaches.py [new file with mode: 0644]

index c91c14213e99ae00226065d17129d96be90f1e55..9769ff602f65be54d5cf19eca52501765f3c6b58 100644 (file)
@@ -20,6 +20,7 @@ class MenuScene(Scene):
             TextButton("Play", action=self.change_to_level),
             TextButton("View Last Generated Level",
                        action=self.change_to_viewer),
+            TextButton("Manage Roaches", action=self.change_to_roaches),
             TextButton("Credits", action=self.change_to_credits),
             TextButton("Quit", action=self.quit),
         ]
@@ -39,6 +40,10 @@ class MenuScene(Scene):
         from .viewlevel import ViewLevelScene
         return [ChangeSceneEvent(ViewLevelScene('map'))]
 
+    def change_to_roaches(self):
+        from .roaches import RoachesScene
+        return [ChangeSceneEvent(RoachesScene())]
+
     def change_to_credits(self):
         from .credits import CreditsScene
         return [ChangeSceneEvent(CreditsScene())]
diff --git a/koperkapel/scenes/roaches.py b/koperkapel/scenes/roaches.py
new file mode 100644 (file)
index 0000000..429ec8f
--- /dev/null
@@ -0,0 +1,19 @@
+""" Roach management scene. """
+
+from pgzero.constants import keys
+from .base import Scene, ChangeSceneEvent
+
+
+class RoachesScene(Scene):
+    """ Roach management scene. """
+
+    def __init__(self):
+        pass
+
+    def draw(self, screen, viewport):
+        screen.clear()
+
+    def on_key_down(self, key, mod, unicode):
+        if key == keys.ESCAPE:
+            from .menu import MenuScene
+            return [ChangeSceneEvent(MenuScene())]