projects
/
koperkapel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
bb8628f
)
Add quit event.
author
Simon Cross
<hodgestar@gmail.com>
Sun, 28 Feb 2016 21:38:17 +0000
(23:38 +0200)
committer
Simon Cross
<hodgestar@gmail.com>
Sun, 28 Feb 2016 21:38:17 +0000
(23:38 +0200)
koperkapel/scenes/base.py
patch
|
blob
|
history
diff --git
a/koperkapel/scenes/base.py
b/koperkapel/scenes/base.py
index b6d6ff9bf86262a89345e0de38f8c0fadb162286..58f3874f204b87a874751d593f4360a785791a70 100644
(file)
--- a/
koperkapel/scenes/base.py
+++ b/
koperkapel/scenes/base.py
@@
-30,6
+30,10
@@
class Engine:
self._scene = scene
self._scene.enter()
+ def quit_game(self):
+ from pgzero.game import exit
+ exit()
+
@apply_events
def update(self, dt):
return self._scene.update(dt)
@@
-77,6
+81,12
@@
class ChangeSceneEvent(Event):
ENGINE_METHOD = "change_scene"
+class QuitEvent(Event):
+ """ Quit the game. """
+
+ ENGINE_METHOD = "quit_game"
+
+
class Actors:
""" A list of actors. """