projects
/
naja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
30397c4
)
win & lose return to main menu
author
Neil
<neil@dip.sun.ac.za>
Sat, 17 May 2014 14:54:24 +0000
(16:54 +0200)
committer
Neil
<neil@dip.sun.ac.za>
Sat, 17 May 2014 15:05:12 +0000
(17:05 +0200)
naja/scenes/lose.py
patch
|
blob
|
history
naja/scenes/win.py
patch
|
blob
|
history
diff --git
a/naja/scenes/lose.py
b/naja/scenes/lose.py
index 6fe9b4f36aabe2a79bfdfcac77cb64c3d29c5c9d..b7b9e3c0ee159fb22fa75f75eefc9afec0012ad2 100644
(file)
--- a/
naja/scenes/lose.py
+++ b/
naja/scenes/lose.py
@@
-8,7
+8,7
@@
from naja.constants import KEYS, PALETTE
from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
-from naja.events import
QuitGam
eEvent
+from naja.events import
SceneChang
eEvent
class LoseScene(Scene):
class LoseScene(Scene):
@@
-35,12
+35,15
@@
class LoseScene(Scene):
(50, 300), '\n\n'.join([
"Something went terribly wrong.",
"You should re-evaluate your life choices.",
(50, 300), '\n\n'.join([
"Something went terribly wrong.",
"You should re-evaluate your life choices.",
+ "",
+ "Press ESC to return to the menu",
]), fontsize=32,
colour='white', padding=1, border=1,
bg_colour='black', border_colour='black',
box_width=300))
def handle_scene_event(self, ev):
]), fontsize=32,
colour='white', padding=1, border=1,
bg_colour='black', border_colour='black',
box_width=300))
def handle_scene_event(self, ev):
+ from naja.scenes.menu import MenuScene
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
-
QuitGameEvent.post(
)
+
SceneChangeEvent.post(MenuScene
)
return
return
diff --git
a/naja/scenes/win.py
b/naja/scenes/win.py
index 77df66f6a15bbb1164be9a143329baeb422579bf..f8b42b32e63f49cd239d08177bc648ea8f4eac76 100644
(file)
--- a/
naja/scenes/win.py
+++ b/
naja/scenes/win.py
@@
-5,7
+5,7
@@
Win scene.
import pygame.locals as pgl
from naja.constants import KEYS, PALETTE
import pygame.locals as pgl
from naja.constants import KEYS, PALETTE
-from naja.events import
QuitGam
eEvent
+from naja.events import
SceneChang
eEvent
from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
@@
-31,12
+31,15
@@
class WinScene(Scene):
"You're great.",
"You did well.",
"You should be proud of yourself.",
"You're great.",
"You did well.",
"You should be proud of yourself.",
+ "",
+ "Press ESC to return to the menu",
]),
colour=PALETTE.WHITE, padding=1, border=1,
bg_colour=PALETTE.BLACK, border_colour=PALETTE.BLACK,
box_width=300))
def handle_scene_event(self, ev):
]),
colour=PALETTE.WHITE, padding=1, border=1,
bg_colour=PALETTE.BLACK, border_colour=PALETTE.BLACK,
box_width=300))
def handle_scene_event(self, ev):
+ from naja.scenes.menu import MenuScene
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
-
QuitGameEvent.post(
)
+
SceneChangeEvent.post(MenuScene
)
return
return