Mercurial > fife-parpg
comparison demos/shooter/scripts/world.py @ 465:4e58dab2fcdc
Added the high score dialog to ask for players name (with no validation yet)
Enabled modal execution.
Fixed a small bug where the scene tries to remove a projectile that it already removed from the scene.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 13 Apr 2010 20:23:13 +0000 |
parents | be035dff788a |
children | 4d0aa75a82f1 |
comparison
equal
deleted
inserted
replaced
464:be035dff788a | 465:4e58dab2fcdc |
---|---|
188 | 188 |
189 def gameOver(self): | 189 def gameOver(self): |
190 self._gameover.show() | 190 self._gameover.show() |
191 | 191 |
192 if self._highscores.isHighScore(self.scene.player.score): | 192 if self._highscores.isHighScore(self.scene.player.score): |
193 self._highscores.addHighScore(HighScore("player", self.scene.player.score)) | 193 dlg = pychan.loadXML('gui/highscoredialog.xml') |
194 dlg.execute({ 'okay' : "Yay!" }) | |
195 name = dlg.findChild(name='name').text | |
196 self._highscores.addHighScore(HighScore(name, self.scene.player.score)) | |
194 self._highscores.show() | 197 self._highscores.show() |
195 | 198 |
196 | |
197 | 199 |
198 def newGame(self): | 200 def newGame(self): |
199 self.loadLevel("maps/shooter_map1.xml") | 201 self.loadLevel("maps/shooter_map1.xml") |
200 self._mainmenu.hide() | 202 self._mainmenu.hide() |
201 self._paused = False | 203 self._paused = False |