예제 #1
0
 def loadMap( self, mapName, playId ):
     #So playId is here to make sure the clients always have the same sound id as the host.
     playState = self.playStateRef()
     if not (mapName is "Untitled"):
         #So, if there is a level name, load that level if found.
         newState = loadPlayState( mapName, playState.floor.tileSet, playState.devMenuRef, networkClient=self )
         if newState is None:
             print "Host was on a level you don't have. Requesting download"
             self.connection.net_requestMapBuffer( self.networkTick, mapName )
             return None
         else:
             playState.swap( newState )
     
     playState.soundManager.idGen = IdSource()
     if playId != 0:
         for each in xrange( playId+1 ):
             playState.soundManager.idGen.getId()
     playState.soundManager.curPlayId = playId
     #On a successful load, request state info.
     self.connection.net_requestState( self.networkTick )
예제 #2
0
 def loadGame( self ):
     ActualManager.displayedPopulation = 3000000
     ActualManager.population = 3000000
     ActualManager.populationCounter = None
     ActualManager.ammoHudElements = []
     ActualManager.selectedLaserNum = 0
     ActualManager.lasers = []
     ActualManager.cities = []
     ActualManager.preparedShots = []
     ActualManager.shakeTimer = 0.0
     ActualManager.shakeAmp = 0.0
     ActualManager.onStartScreen = True
     ActualManager.waveNumber = 0
     ActualManager.waveTimer = 3.0
     ActualManager.waveLabel = None
     ActualManager.endGameNotice = None
     ActualManager.otherEndGameNotice = None
     playState = self.playStateRef()
     newState = loadPlayState( os.path.join( "data", "maps", "empty" ), playState.floor.tileSet, playState.devMenuRef )
     playState.swap(newState)
     ActualManager.onStartScreen = False
예제 #3
0
 def loadGame(self):
     ActualManager.displayedPopulation = 3000000
     ActualManager.population = 3000000
     ActualManager.populationCounter = None
     ActualManager.ammoHudElements = []
     ActualManager.selectedLaserNum = 0
     ActualManager.lasers = []
     ActualManager.cities = []
     ActualManager.preparedShots = []
     ActualManager.shakeTimer = 0.0
     ActualManager.shakeAmp = 0.0
     ActualManager.onStartScreen = True
     ActualManager.waveNumber = 0
     ActualManager.waveTimer = 3.0
     ActualManager.waveLabel = None
     ActualManager.endGameNotice = None
     ActualManager.otherEndGameNotice = None
     playState = self.playStateRef()
     newState = loadPlayState(os.path.join("data", "maps", "empty"),
                              playState.floor.tileSet, playState.devMenuRef)
     playState.swap(newState)
     ActualManager.onStartScreen = False
예제 #4
0
 def push( self, clickKey, click ):
     if "up" in clickKey:
         playState = self.parentState.menu.playState
         playState.swap( loadPlayState( os.path.join( "data", "maps", self.text ), playState.floor.tileSet, playState.devMenuRef, justEditing=True ) )
         self.parentState.menu.rerenderEverythingIn = 1
         self.parentState.menu.backToDefault()