def down_stairs(self): if not self._floor.is_down_stairs_at(self._player.position()): return if not self._floor.is_last_floor(): self._floor.next() self._screen.clear() else: GameScene.change(EndingScene())
def events(self, events, pressed_keys): for event in events: if event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN: # Move to the next scene when the user pressed Enter self.change_scene(GameScene())
from splash import Scene as SplashScene from game import Scene as GameScene if __name__ == '__main__': SplashScene().start() GameScene().start()
def update(self): key = self._screen.read_key() GameScene.change(DungeonScene())