Converted to ogg via:
mpg123 -w test.wav another_beek_beep_beer_please.mp3
sox test.wav another_beek.ogg vol 0.25 amplitude
+
+ A_ninja.ogg
+ A ninja among culturachippers
+ Downloaded from: http://freemusicarchive.org/music/Rolemusic/gigs_n_contest/rolemusic_-_gigs_n_contest_-_01_A_ninja_among_culturachippers
+ License: Creative Commons Attribution (CC-BY) (http://creativecommons.org/licenses/by/4.0/)
+ Converted to ogg via:
+ mpg123 -w test.wav A_ninja.mp3
+ sox test.wav A_ninja.ogg vol 0.25 amplitude channels 1
from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
-from naja.events import QuitGameEvent
+from naja.events import SceneChangeEvent, LoadGameEvent
class LoseScene(Scene):
(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):
+ from naja.scenes.menu import MenuScene
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
- QuitGameEvent.post()
+ # drop current state
+ LoadGameEvent.post(None)
+ SceneChangeEvent.post(MenuScene)
return
import pygame.locals as pgl
from naja.constants import KEYS, PALETTE
-from naja.events import QuitGameEvent
+from naja.events import SceneChangeEvent, LoadGameEvent
+from naja.sound import sound
from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
"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))
+ sound.play_music('A_ninja.ogg')
def handle_scene_event(self, ev):
+ from naja.scenes.menu import MenuScene
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
- QuitGameEvent.post()
+ sound.stop()
+ # drop current state
+ LoadGameEvent.post(None)
+ SceneChangeEvent.post(MenuScene)
return