diff 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
line wrap: on
line diff
--- a/demos/shooter/scripts/world.py	Mon Apr 12 20:41:24 2010 +0000
+++ b/demos/shooter/scripts/world.py	Tue Apr 13 19:43:31 2010 +0000
@@ -74,6 +74,9 @@
 		self._gameover = GameOverDisplay()
 		self._gameover.hide()
 		
+		self._highscores = HighScores(self)
+		self._highscores.hide()
+		
 		self._genericrenderer = None
 		
 	def showMainMenu(self):
@@ -89,7 +92,7 @@
 		pass
 		
 	def showHighScores(self):
-		pass
+		self._highscores.show()
 		
 	def quit(self):
 		self.reset()
@@ -185,6 +188,12 @@
 
 	def gameOver(self):
 		self._gameover.show()
+		
+		if self._highscores.isHighScore(self.scene.player.score):
+			self._highscores.addHighScore(HighScore("player", self.scene.player.score))
+			self._highscores.show()
+			
+
 
 	def newGame(self):
 		self.loadLevel("maps/shooter_map1.xml")