def onBegin(self): bs.TeamGameActivity.onBegin(self) self._updateScoreBoard() self._targets = [] # number of targets is based on player count numTargets = min(5,len(self.initialPlayerInfo)+2) for i in range(numTargets): bs.gameTimer(5000+i*1000,self._spawnTarget) # this wrangles our bots self._bots = bs.BotSet() # start some timers to spawn bots bs.gameTimer(1000,bs.Call(self._bots.spawnBot,bs.ToughGuyBot,pos=(3,3,-2),spawnTime=3000)) #bs.gameTimer(2000,bs.Call(self._bots.spawnBot,bs.ToughGuyBot,pos=(-3,3,-2),spawnTime=3000)) #bs.gameTimer(3000,bs.Call(self._bots.spawnBot,bs.NinjaBot,pos=(5,3,-2),spawnTime=3000)) #bs.gameTimer(4000,bs.Call(self._bots.spawnBot,bs.NinjaBot,pos=(-5,3,-2),spawnTime=3000)) # add a few extras for multiplayer if len(self.initialPlayerInfo) > 2: bs.gameTimer(5000,bs.Call(self._bots.spawnBot,bs.ToughGuyBot,pos=(0,3,-5),spawnTime=3000)) if len(self.initialPlayerInfo) > 3: bs.gameTimer(6000,bs.Call(self._bots.spawnBot,bs.ToughGuyBot,pos=(0,3,1),spawnTime=3000)) # note: if spawns were spread out more we'd probably want to set some sort of flag on the # last spawn to ensure we don't inadvertantly allow a 'win' before every bot is spawned. # (ie: if bot 1, 2, and 3 got killed but 4 hadn't spawned yet, the game might end because # it sees no remaining bots. self._updateTimer = bs.Timer(1000,self._update,repeat=True) self._countdown = bs.OnScreenCountdown(150,endCall=self.endGame) bs.gameTimer(4000,self._countdown.start)
def onBegin(self): bs.TeamGameActivity.onBegin(self) # End the game in a minute bs.gameTimer(60000, bs.WeakCall(self.endGame)) bs.OnScreenCountdown(60).start() # Call the method to spawn our kronks bs.gameTimer(1000, bs.WeakCall(self.spawnBots)) self._gamescore = 0 # Set up a scoreboard self._scoredis = bs.ScoreBoard() self._scoredis.setTeamValue(self.teams[0], self._gamescore) # Enable powerups with TNT self.setupStandardPowerupDrops(enableTNT=True)
def onBegin(self): bs.TeamGameActivity.onBegin(self) self._updateScoreBoard() self._targets = [] # number of targets is based on player count #numTargets = min(5,len(self.initialPlayerInfo)+2) numTargets = self.settings['Target Count'] for i in range(numTargets): bs.gameTimer(5000 + i * 1000, self._spawnTarget) self._updateTimer = bs.Timer(1000, self._update, repeat=True) self._countdown = bs.OnScreenCountdown(60, endCall=self.endGame) bs.gameTimer(4000, self._countdown.start)
def onBegin(self): # there's a player-wall on the tower-d level to prevent # players from getting up on the stairs.. we wanna kill that self.setupStandardPowerupDrops() bs.TeamGameActivity.onBegin(self) self._updateScoreBoard() self._updateTimer = bs.Timer(250, self._update, repeat=True) self._countdown = bs.OnScreenCountdown(3600, endCall=self.endGame) bs.gameTimer(4000, self._countdown.start) self._bots = bs.BotSet() # spawn evil bunny in co-op only if isinstance(self.getSession(), bs.CoopSession): self._spawnBigMommy()
def onBegin(self): # there's a player-wall on the tower-d level to prevent # players from getting up on the stairs.. we wanna kill that self.getMap().playerWall.delete() bs.TeamGameActivity.onBegin(self) self._updateScoreBoard() self._updateTimer = bs.Timer(250, self._update, repeat=True) self._countdown = bs.OnScreenCountdown(60, endCall=self.endGame) bs.gameTimer(4000, self._countdown.start) self._bots = bs.BotSet() # spawn evil bunny in co-op only if isinstance(self.getSession(), bs.CoopSession) and self._proMode: self._spawnEvilBunny()
def __init__(self, settings): bs.TeamGameActivity.__init__(self, settings) self.called = False if self.settings['Epic Mode']: self._isSlowMotion = True self.info = bs.NodeActor( bs.newNode('text', attrs={ 'vAttach': 'bottom', 'hAlign': 'center', 'vrDepth': 0, 'color': (0, .2, 0), 'shadow': 1.0, 'flatness': 1.0, 'position': (0, 0), 'scale': 0.8, 'text': "Created by MattZ45986 on Github", })) self._scoredis = bs.ScoreBoard() self.timer = bs.OnScreenCountdown(30, self.endGame)
def onBegin(self): self.timer = bs.OnScreenCountdown(self.settings['Time Limit'], endCall=self.endGame) self.timer.start() self.ended = False self.roundNum = 0 self.numPickedUp = 0 self.nodes = [] self.flags = [] bs.screenMessage(str(len(self.flags))) self.spawned = [] self.leftPlayers = 0 self.scores = {} for player in self.players: self.scores[player] = 0 player.gameData['survived'] = True player.gameData['done'] = False player.gameData['score'] = 0 bs.TeamGameActivity.onBegin(self) self.makeRound()