comparison demos/shooter/scripts/gui/guis.py @ 457:597b066d5ccb

Player now has 3 lives and will receive a game over message once they are used up.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 08 Apr 2010 21:18:36 +0000
parents 41fd97da94d1
children be035dff788a
comparison
equal deleted inserted replaced
456:41fd97da94d1 457:597b066d5ccb
80 80
81 self._fpstext = self._widget.findChild(name="fps") 81 self._fpstext = self._widget.findChild(name="fps")
82 self._velocitytext = self._widget.findChild(name="velocity") 82 self._velocitytext = self._widget.findChild(name="velocity")
83 self._positiontext = self._widget.findChild(name="position") 83 self._positiontext = self._widget.findChild(name="position")
84 self._scoretext = self._widget.findChild(name="score") 84 self._scoretext = self._widget.findChild(name="score")
85 self._livestext = self._widget.findChild(name="lives")
85 self._widget.position = (0,0) 86 self._widget.position = (0,0)
86 87
87 def show(self): 88 def show(self):
88 self._widget.show() 89 self._widget.show()
89 90
99 def setVelocityText(self, text): 100 def setVelocityText(self, text):
100 self._velocitytext.text = text 101 self._velocitytext.text = text
101 102
102 def setScoreText(self, text): 103 def setScoreText(self, text):
103 self._scoretext.text = text 104 self._scoretext.text = text
105
106 def setLivesText(self, text):
107 self._livestext.text = text
108
109 class GameOverDisplay(object):
110 def __init__(self):
111 self._widget = pychan.loadXML('gui/gameover.xml')
112
113 def show(self):
114 self._widget.show()
115
116 def hide(self):
117 self._widget.hide()