projects
/
naja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0378814
)
Accusatory win screen.
author
Jeremy Thurgood
<firxen@gmail.com>
Fri, 16 May 2014 20:18:08 +0000
(22:18 +0200)
committer
Jeremy Thurgood
<firxen@gmail.com>
Fri, 16 May 2014 20:18:18 +0000
(22:18 +0200)
naja/scenes/win.py
patch
|
blob
|
history
diff --git
a/naja/scenes/win.py
b/naja/scenes/win.py
index 65765d769014ca38abadb5fa42c4db605ec1cc0c..f4df54f9858b47b6427c4323c90d81d32f613481 100644
(file)
--- a/
naja/scenes/win.py
+++ b/
naja/scenes/win.py
@@
-4,7
+4,7
@@
Win scene.
import pygame.locals as pgl
import pygame.locals as pgl
-from naja.constants import KEYS
+from naja.constants import KEYS
, PALETTE
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget, TextBoxWidget
from naja.events import QuitGameEvent
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget, TextBoxWidget
from naja.events import QuitGameEvent
@@
-17,17
+17,17
@@
class WinScene(Scene):
def __init__(self, state):
super(WinScene, self).__init__(state)
def __init__(self, state):
super(WinScene, self).__init__(state)
- self.add(TextWidget(
-
(480, 160), 'You won!', fontsize=32, colour='white'
))
+ self.add(TextWidget(
(50, 50), 'You won!', colour=PALETTE.WHITE))
+
self.add(TextWidget((50 + 64, 50), 'CHEATER!', colour=PALETTE.ORANGE
))
self.add(TextBoxWidget(
self.add(TextBoxWidget(
- (
120, 3
0), '\n'.join([
+ (
50, 10
0), '\n'.join([
"You're great.",
"You did well.",
"You should be proud of yourself.",
"You're great.",
"You did well.",
"You should be proud of yourself.",
- ]),
fontsize=32,
- colour=
'white'
, padding=1, border=1,
- bg_colour=
'black', border_colour='black'
,
- box_width=
1
00))
+ ]),
+ colour=
PALETTE.WHITE
, padding=1, border=1,
+ bg_colour=
PALETTE.BLACK, border_colour=PALETTE.BLACK
,
+ box_width=
3
00))
def handle_scene_event(self, ev):
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
def handle_scene_event(self, ev):
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT: