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),
]
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())]
--- /dev/null
+""" 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())]