diff 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
line wrap: on
line diff
--- a/demos/shooter/scripts/world.py	Tue Apr 13 19:43:31 2010 +0000
+++ b/demos/shooter/scripts/world.py	Tue Apr 13 20:23:13 2010 +0000
@@ -190,11 +190,13 @@
 		self._gameover.show()
 		
 		if self._highscores.isHighScore(self.scene.player.score):
-			self._highscores.addHighScore(HighScore("player", self.scene.player.score))
+			dlg = pychan.loadXML('gui/highscoredialog.xml')
+			dlg.execute({ 'okay' : "Yay!" })
+			name = dlg.findChild(name='name').text
+			self._highscores.addHighScore(HighScore(name, self.scene.player.score))
 			self._highscores.show()
 			
 
-
 	def newGame(self):
 		self.loadLevel("maps/shooter_map1.xml")
 		self._mainmenu.hide()