def setGameStart(self, timestamp): if not self.hasLocalToon: return None self.notify.debug('setGameStart') DistributedMinigame.DistributedMinigame.setGameStart(self, timestamp) for avId in self.remoteAvIdList: toon = self.getAvatar(avId) if toon: toon.stopLookAround() continue self.scores = [0] * self.numPlayers spacing = 0.40000000000000002 for i in xrange(self.numPlayers): avId = self.avIdList[i] avName = self.getAvatarName(avId) scorePanel = MinigameAvatarScorePanel.MinigameAvatarScorePanel( avId, avName) scorePanel.setScale(0.90000000000000002) scorePanel.setPos(0.75 - spacing * (self.numPlayers - 1 - i), 0.0, 0.875) scorePanel.makeTransparent(0.75) self.scorePanels.append(scorePanel) self.arrowKeys.setPressHandlers([ self._DistributedIceGame__upArrowPressed, self._DistributedIceGame__downArrowPressed, self._DistributedIceGame__leftArrowPressed, self._DistributedIceGame__rightArrowPressed, self._DistributedIceGame__controlPressed ])
def enterPlay(self): self.notify.debug('enterPlay') for i in xrange(self.numPlayers): avId = self.avIdList[i] avName = self.getAvatarName(avId) scorePanel = MinigameAvatarScorePanel.MinigameAvatarScorePanel( avId, avName) scorePanel.setPos(-0.213, 0.0, 0.28 * i + 0.66) scorePanel.reparentTo(base.a2dBottomRight) self.scorePanels.append(scorePanel) base.setCellsActive(base.rightCells, 0) self.walkStateData.enter() self.walkStateData.fsm.request('walking') if base.localAvatar.isIt: base.mouseInterfaceNode.setForwardSpeed( ToontownGlobals.ToonForwardSpeed * self.IT_SPEED_INCREASE) base.mouseInterfaceNode.setRotateSpeed( ToontownGlobals.ToonRotateSpeed * self.IT_ROT_INCREASE) self.timer = ToontownTimer.ToontownTimer() self.timer.posInTopRightCorner() self.timer.setTime(self.DURATION) self.timer.countdown(self.DURATION, self.timerExpired) base.playMusic(self.music, looping=1, volume=0.9) base.localAvatar.setIdealCameraPos(Point3(0, -24, 8))
def enterPlay(self): self.notify.debug('enterPlay') for i in xrange(self.numPlayers): avId = self.avIdList[i] avName = self.getAvatarName(avId) scorePanel = MinigameAvatarScorePanel.MinigameAvatarScorePanel(avId, avName) scorePanel.reparentTo(base.a2dTopRight) scorePanel.setPos(-0.213, 0.0, -0.5 - 0.28 * i) self.scorePanels.append(scorePanel) self.goalBar.show() self.goalBar['value'] = 0.0 base.setCellsActive(base.rightCells, 0) self.__spawnUpdateSuitsTask() orthoDrive = OrthoDrive(self.TOON_SPEED, maxFrameMove=self.MAX_FRAME_MOVE, customCollisionCallback=self.__doMazeCollisions, priority=1) self.orthoWalk = OrthoWalk(orthoDrive, broadcast=not self.isSinglePlayer()) self.orthoWalk.start() self.accept(MazeSuit.COLLISION_EVENT_NAME, self.__hitBySuit) self.accept(self.TREASURE_GRAB_EVENT_NAME, self.__treasureGrabbed) self.timer = ToontownTimer.ToontownTimer() self.timer.posInTopRightCorner() self.timer.setTime(MazeGameGlobals.GAME_DURATION) self.timer.countdown(MazeGameGlobals.GAME_DURATION, self.timerExpired) self.accept('resetClock', self.__resetClock) base.playMusic(self.music, looping=0, volume=0.8)
def enterPlay(self): self.notify.debug('enterPlay') self.orthoWalk.start() for suit in self.suits: suitCollSphere = CollisionSphere(0, 0, 0, 1.0) suit.collSphereName = 'suitCollSphere%s' % self.suits.index(suit) suitCollSphere.setTangible(0) suitCollNode = CollisionNode(self.uniqueName(suit.collSphereName)) suitCollNode.setIntoCollideMask(ToontownGlobals.WallBitmask) suitCollNode.addSolid(suitCollSphere) suit.collNodePath = suit.attachNewNode(suitCollNode) suit.collNodePath.hide() if self.ShowSuitSpheres: suit.collNodePath.show() self.accept(self.uniqueName('enter' + suit.collSphereName), self.handleSuitCollision) self.scores = [0] * self.numPlayers spacing = 0.4 for i in xrange(self.numPlayers): avId = self.avIdList[i] avName = self.getAvatarName(avId) scorePanel = MinigameAvatarScorePanel.MinigameAvatarScorePanel( avId, avName) scorePanel.setScale(0.9) scorePanel.setPos(-0.583 - spacing * (self.numPlayers - 1 - i), 0.0, -0.15) scorePanel.reparentTo(base.a2dTopRight) scorePanel.makeTransparent(0.75) self.scorePanels.append(scorePanel) self.fruitsCaught = 0 self.droppedObjCaught = {} self.dropIntervals = {} self.droppedObjNames = [] self.dropSchedule = [] self.numItemsDropped = 0 self.scheduleDrops() self.startDropTask() if self.WantSuits: self.startSuitWalkTask() self.timer = ToontownTimer.ToontownTimer() self.timer.posInTopRightCorner() self.timer.setTime(CatchGameGlobals.GameDuration) self.timer.countdown(CatchGameGlobals.GameDuration, self.timerExpired) self.timer.setTransparency(1) self.timer.setColorScale(1, 1, 1, 0.75) base.playMusic(self.music, looping=0, volume=0.9)
def setGameStart(self, timestamp): if not self.hasLocalToon: return self.notify.debug('setGameStart') DistributedMinigame.setGameStart(self, timestamp) self.twoDWalk = TwoDWalk(self.twoDDrive, broadcast=not self.isSinglePlayer()) self.scores = [0] * self.numPlayers spacing = 0.4 for i in xrange(self.numPlayers): avId = self.avIdList[i] avName = self.getAvatarName(avId) scorePanel = MinigameAvatarScorePanel.MinigameAvatarScorePanel( avId, avName) scorePanel.setScale(0.9) scorePanel.setPos(-0.583 - spacing * (self.numPlayers - 1 - i), 0.0, -0.15) scorePanel.reparentTo(base.a2dTopRight) scorePanel.makeTransparent(0.75) self.scorePanels.append(scorePanel) self.gameFSM.request('play', [timestamp])