Mercurial > fife-parpg
diff 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 |
line wrap: on
line diff
--- a/demos/shooter/scripts/gui/guis.py Wed Apr 07 21:26:26 2010 +0000 +++ b/demos/shooter/scripts/gui/guis.py Thu Apr 08 21:18:36 2010 +0000 @@ -82,6 +82,7 @@ self._velocitytext = self._widget.findChild(name="velocity") self._positiontext = self._widget.findChild(name="position") self._scoretext = self._widget.findChild(name="score") + self._livestext = self._widget.findChild(name="lives") self._widget.position = (0,0) def show(self): @@ -100,4 +101,17 @@ self._velocitytext.text = text def setScoreText(self, text): - self._scoretext.text = text \ No newline at end of file + self._scoretext.text = text + + def setLivesText(self, text): + self._livestext.text = text + +class GameOverDisplay(object): + def __init__(self): + self._widget = pychan.loadXML('gui/gameover.xml') + + def show(self): + self._widget.show() + + def hide(self): + self._widget.hide() \ No newline at end of file