comparison demos/shooter/scripts/world.py @ 464:be035dff788a

Added high score window. Added the ability to save high scores.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 13 Apr 2010 19:43:31 +0000
parents c4f745a566d6
children 4e58dab2fcdc
comparison
equal deleted inserted replaced
463:ac0f62a07a3e 464:be035dff788a
72 self._hudwindow.hide() 72 self._hudwindow.hide()
73 73
74 self._gameover = GameOverDisplay() 74 self._gameover = GameOverDisplay()
75 self._gameover.hide() 75 self._gameover.hide()
76 76
77 self._highscores = HighScores(self)
78 self._highscores.hide()
79
77 self._genericrenderer = None 80 self._genericrenderer = None
78 81
79 def showMainMenu(self): 82 def showMainMenu(self):
80 if self.scene: 83 if self.scene:
81 self._paused = True 84 self._paused = True
87 90
88 def showCredits(self): 91 def showCredits(self):
89 pass 92 pass
90 93
91 def showHighScores(self): 94 def showHighScores(self):
92 pass 95 self._highscores.show()
93 96
94 def quit(self): 97 def quit(self):
95 self.reset() 98 self.reset()
96 self._applictaion.requestQuit() 99 self._applictaion.requestQuit()
97 100
183 node_bottomright.thisown = 0 186 node_bottomright.thisown = 0
184 node_bottomleft.thisown = 0 187 node_bottomleft.thisown = 0
185 188
186 def gameOver(self): 189 def gameOver(self):
187 self._gameover.show() 190 self._gameover.show()
191
192 if self._highscores.isHighScore(self.scene.player.score):
193 self._highscores.addHighScore(HighScore("player", self.scene.player.score))
194 self._highscores.show()
195
196
188 197
189 def newGame(self): 198 def newGame(self):
190 self.loadLevel("maps/shooter_map1.xml") 199 self.loadLevel("maps/shooter_map1.xml")
191 self._mainmenu.hide() 200 self._mainmenu.hide()
192 self._paused = False 201 self._paused = False