def loadCity(self, filePath):
     if self.engine is not None:
         pyglet.clock.unschedule(self.engine.simulate)
     newSpeedInt, self.engine = Engine.loadCity(filePath)
     self.cityView.resetEng(self.engine)
     self.controlView.resetEng(self.engine)
     if 0 <= newSpeedInt < len(speeds):
         self.setSpeed(speeds.items()[newSpeedInt][1])
     else:
         self.setSpeed(speeds['Paused'])
     self.engine.push_handlers(self)
     self.soundPlayer.playMusic("MUSIC")
Exemple #2
0
 def loadCity(self, filePath):
     if self.engine is not None:
         pyglet.clock.unschedule(self.engine.simulate)
     newSpeedInt, self.engine = Engine.loadCity(filePath)
     self.cityView.resetEng(self.engine)
     self.controlView.resetEng(self.engine)
     if 0 <= newSpeedInt < len(speeds):
         self.setSpeed(speeds.items()[newSpeedInt][1])
     else:
         self.setSpeed(speeds['Paused'])
     self.engine.push_handlers(self)
     self.soundPlayer.playMusic("MUSIC")
 def incrementSpeed(self):
     curSpeedAsInt = list(speeds.keys()).index(self.speed.name)
     newSpeedAsInt = (curSpeedAsInt + 1) % len(speeds)
     self.setSpeed(list(speeds.items())[newSpeedAsInt][1])
Exemple #4
0
 def incrementSpeed(self):
     curSpeedAsInt = list(speeds.keys()).index(self.speed.name)
     newSpeedAsInt = (curSpeedAsInt + 1) % len(speeds)
     self.setSpeed(list(speeds.items())[newSpeedAsInt][1])