comparison demos/shooter/run.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 3164715a0621
comparison
equal deleted inserted replaced
464:be035dff788a 465:4e58dab2fcdc
47 self.world = world 47 self.world = world
48 engine.getEventManager().setNonConsumableKeys([ 48 engine.getEventManager().setNonConsumableKeys([
49 fife.Key.ESCAPE,]) 49 fife.Key.ESCAPE,])
50 50
51 self.quit = False 51 self.quit = False
52 52
53 def keyPressed(self, evt): 53 def keyPressed(self, evt):
54 keyval = evt.getKey().getValue() 54 keyval = evt.getKey().getValue()
55 keystr = evt.getKey().getAsString().lower() 55 keystr = evt.getKey().getAsString().lower()
56 consumed = False 56 consumed = False
57 if keyval == fife.Key.ESCAPE: 57 if keyval == fife.Key.ESCAPE:
66 66
67 class Shooter(ApplicationBase): 67 class Shooter(ApplicationBase):
68 def __init__(self): 68 def __init__(self):
69 super(Shooter,self).__init__() 69 super(Shooter,self).__init__()
70 pychan.init(self.engine, debug=False) 70 pychan.init(self.engine, debug=False)
71 pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop)
71 72
72 self.world = world.World(self, self.engine) 73 self.world = world.World(self, self.engine)
73 self.listener = ApplicationListener(self.engine, self.world) 74 self.listener = ApplicationListener(self.engine, self.world)
74 75
75 def requestQuit(self): 76 def requestQuit(self):