本文整理汇总了Python中DistributedMinigame.DistributedMinigame.onstage方法的典型用法代码示例。如果您正苦于以下问题:Python DistributedMinigame.onstage方法的具体用法?Python DistributedMinigame.onstage怎么用?Python DistributedMinigame.onstage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DistributedMinigame.DistributedMinigame
的用法示例。
在下文中一共展示了DistributedMinigame.onstage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onstage
# 需要导入模块: from DistributedMinigame import DistributedMinigame [as 别名]
# 或者: from DistributedMinigame.DistributedMinigame import onstage [as 别名]
def onstage(self):
self.notify.debug('onstage')
DistributedMinigame.onstage(self)
self.maze.onstage()
self.randomNumGen.shuffle(self.startPosHTable)
lt = base.localAvatar
lt.reparentTo(render)
lt.hideName()
self.__placeToon(self.localAvId)
lt.setAnimState('Happy', 1.0)
lt.setSpeed(0, 0)
self.camParent = render.attachNewNode('mazeGameCamParent')
self.camParent.reparentTo(base.localAvatar)
self.camParent.setPos(0, 0, 0)
self.camParent.setHpr(render, 0, 0, 0)
camera.reparentTo(self.camParent)
camera.setPos(self.camOffset)
self.__spawnCameraTask()
self.toonRNGs = []
for i in xrange(self.numPlayers):
self.toonRNGs.append(RandomNumGen.RandomNumGen(self.randomNumGen))
self.treasures = []
for i in xrange(self.maze.numTreasures):
self.treasures.append(MazeTreasure.MazeTreasure(self.treasureModel, self.maze.treasurePosList[i], i, self.doId))
self.__loadSuits()
for suit in self.suits:
suit.onstage()
self.sndTable = {'hitBySuit': [None] * self.numPlayers,
'falling': [None] * self.numPlayers}
for i in xrange(self.numPlayers):
self.sndTable['hitBySuit'][i] = base.loadSfx('phase_4/audio/sfx/MG_Tag_C.ogg')
self.sndTable['falling'][i] = base.loadSfx('phase_4/audio/sfx/MG_cannon_whizz.ogg')
self.grabSounds = []
for i in xrange(5):
self.grabSounds.append(base.loadSfx('phase_4/audio/sfx/MG_maze_pickup.ogg'))
self.grabSoundIndex = 0
for avId in self.avIdList:
self.toonHitTracks[avId] = Wait(0.1)
self.scores = [0] * self.numPlayers
self.goalBar = DirectWaitBar(parent=render2d, relief=DGG.SUNKEN, frameSize=(-0.35,
0.35,
-0.15,
0.15), borderWidth=(0.02, 0.02), scale=0.42, pos=(0.84, 0, 0.5 - 0.28 * self.numPlayers + 0.05), barColor=(0, 0.7, 0, 1))
self.goalBar.setBin('unsorted', 0)
self.goalBar.hide()
self.introTrack = self.getIntroTrack()
self.introTrack.start()
return