예제 #1
0
 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()
예제 #2
0
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
예제 #3
0
 def stop_scene(self):
     # Empty the queue before changing scenes.
     self.flush_events()
     self.signal(events.SceneStopped())
     self.publish()
     self.scenes.pop()