コード例 #1
0
 def onTransitionIn(self):
     bs.CoopGameActivity.onTransitionIn(self, music='Epic')
     bs.gameTimer(1300, bs.Call(bs.playSound, self._newWaveSound))
     self._scoreBoard = bs.ScoreBoard(label=bs.Lstr(resource='scoreText'),
                                      scoreSplit=0.5)
     # we use this in place of a regular int to make it harder to hack scores
     self._score = bs.SecureInt(0)
コード例 #2
0
    def onTransitionIn(self):

        bs.CoopGameActivity.onTransitionIn(self)

        # show special landmine tip on rookie preset
        if self._preset in ['rookie', 'rookieEasy']:
            # show once per session only (then we revert to regular tips)
            if not hasattr(bs.getSession(), '_gShowedOnslaughtLandMineTip'):
                bs.getSession()._gShowedOnslaughtLandMineTip = True
                self.tips = [
                    {'tip': "Land-mines are a good way to stop speedy enemies.",
                     'icon': bs.getTexture('powerupLandMines'),
                     'sound': bs.getSound('ding')}]

        # show special tnt tip on pro preset
        if self._preset in ['pro', 'proEasy']:
            # show once per session only (then we revert to regular tips)
            if not hasattr(bs.getSession(), '_gShowedOnslaughtTntTip'):
                bs.getSession()._gShowedOnslaughtTntTip = True
                self.tips = [{
                    'tip':
                    "Take out a group of enemies by\nsetting"
                    " off a bomb near a TNT box.",
                    'icon': bs.getTexture('tnt'),
                    'sound': bs.getSound('ding')}]

        # show special curse tip on uber preset
        if self._preset in ['uber', 'uberEasy']:
            # show once per session only (then we revert to regular tips)
            if not hasattr(bs.getSession(), '_gShowedOnslaughtCurseTip'):
                bs.getSession()._gShowedOnslaughtCurseTip = True
                self.tips = [{
                    'tip':
                    "Curse boxes turn you into a ticking time bomb.\n"
                    "The only cure is to quickly grab a health-pack.",
                    'icon': bs.getTexture('powerupCurse'),
                    'sound': bs.getSound('ding')}]

        self._spawnInfoText = bs.NodeActor(
            bs.newNode(
                "text",
                attrs={'position': (15, -130),
                       'hAttach': "left", 'vAttach': "top", 'scale': 0.55,
                       'color': (0.3, 0.8, 0.3, 1.0),
                       'text': ''}))
        bs.playMusic('Onslaught')

        self._scoreBoard = bs.ScoreBoard(
            label=bs.Lstr(resource='scoreText'),
            scoreSplit=0.5)
        self._gameOver = False
        self._wave = 0
        self._canEndWave = True
        # we use this in place of a regular int to make it harder to hack scores
        self._score = bs.SecureInt(0)
        self._timeBonus = 0
コード例 #3
0
 def onTransitionIn(self):
     bs.screenMessage(
         bs.Lstr(resource='musicText').evaluate()+'Violet7rip - For everything')
     bs.CoopGameActivity.onTransitionIn(self, music='ForEverything')
     bs.gameTimer(1300, bs.Call(bs.playSound, self._newWaveSound))
     self._scoreBoard = bs.ScoreBoard(
         label=bs.Lstr(resource='scoreText'),
         scoreSplit=0.5)
     # we use this in place of a regular int to make it harder to hack scores
     self._score = bs.SecureInt(0)
コード例 #4
0
    def onTransitionIn(self):

        bs.CoopGameActivity.onTransitionIn(self, music='Marching')

        self._scoreBoard = bs.ScoreBoard(label=bs.Lstr(resource='scoreText'),
                                         scoreSplit=0.5)
        self._gameOver = False
        self._wave = 0
        self._canEndWave = True
        # we use this in place of a regular int to make it harder to hack scores
        self._score = bs.SecureInt(0)
        self._timeBonus = 0

        self._scoreRegion = bs.NodeActor(
            bs.newNode('region',
                       attrs={
                           'position':
                           self.getMap().defs.boxes['scoreRegion'][0:3],
                           'scale':
                           self.getMap().defs.boxes['scoreRegion'][6:9],
                           'type': 'box',
                           'materials': [self._scoreRegionMaterial]
                       }))
コード例 #5
0
 def onTeamJoin(self, team):
     team.gameData['score'] = bs.SecureInt(
         0
     )  # we use this in place of a regular int to make it harder to hack scores
     if self.hasBegun(): self._updateScoreBoard()