def _stop_scene(self): """Stop the current scene.""" # Empty the queue before changing scenes. self._flush_events() self.signal(events.SceneStopped()) self.publish() self.children.pop_scene()
def test_flush_events(): ge = GameEngine(BaseScene) ge.signal(events.SceneStopped()) ge.signal(events.Quit()) assert len(ge.events) == 2 ge.flush_events() assert len(ge.events) == 0
def stop_scene(self): # Empty the queue before changing scenes. self.flush_events() self.signal(events.SceneStopped()) self.publish() self.scenes.pop()