-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendscene.py
71 lines (61 loc) · 1.99 KB
/
endscene.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""This module contains the game scene 'EndScene'."""
import gtk
import gtk.gdk as gdk
import gobject
import cairo
from pnode import *
from objects import *
from uicomponents import *
from effects import *
from motions import *
class EndScene(Node):
"""The game scene to display the end roll."""
def __init__(self, parent, style, key_down, key_up, on_game_reset):
super(EndScene, self).__init__(parent, style)
# Same as in MenuScene
self.key_up = key_up
self.key_down = key_down
# Function on_game_reset() is called to return to the main menu
self.on_game_reset = on_game_reset
# "Thank You"
list = Selections(
parent=self,
style={'height': '30%', 'top': '15%', 'left': '5%', 'right': '5%'},
font='MS Gothic',
labels=(
u'THANK YOU',
u'FOR YOUR PLAYING!',
),
color=(1, 1, 1, 0.7),
margin=(0, 0, 0, 0),
cursor=None,
)
self.add_node(list)
# Staff
list = Selections(
parent=self,
style={'height': '30%', 'top': '60%', 'left': '10%', 'right': '10%'},
font='MS Gothic',
labels=(
u'<Press Space>',
u' ',
u'Program:',
u' 李 承益 (Victor Lee)',
u'Bombercan\'s Theme:',
u' 沈 威廷 (MWT)'
),
color=(1, 1, 1, 0.7),
margin=(0, 0, 0, 0),
cursor=None,
center=False
)
self.add_node(list)
def on_update(self, cr):
cr.set_source_rgb(0, 0, 0)
cr.paint()
def on_tick(self, interval):
if self.key_up('space'):
# Back to the main menu
self.on_game_reset()