From 22ae4326a187ae76c6904bc8fbf666d8aa147706 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Wed, 2 Mar 2016 16:54:10 +0200 Subject: [PATCH] Skeleton for roach management scene. --- koperkapel/scenes/menu.py | 5 +++++ koperkapel/scenes/roaches.py | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 koperkapel/scenes/roaches.py diff --git a/koperkapel/scenes/menu.py b/koperkapel/scenes/menu.py index c91c142..9769ff6 100644 --- a/koperkapel/scenes/menu.py +++ b/koperkapel/scenes/menu.py @@ -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 index 0000000..429ec8f --- /dev/null +++ b/koperkapel/scenes/roaches.py @@ -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())] -- 2.34.1