本文整理汇总了Python中toontown.minigame.PairingGameGlobals类的典型用法代码示例。如果您正苦于以下问题:Python PairingGameGlobals类的具体用法?Python PairingGameGlobals怎么用?Python PairingGameGlobals使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PairingGameGlobals类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: load
def load(self):
self.notify.debug('load')
DistributedMinigame.load(self)
self.gameDuration = PairingGameGlobals.calcGameDuration(self.getDifficulty())
self.gameBoard = loader.loadModel('phase_4/models/minigames/memory_room')
self.gameBoard.setPosHpr(0.5, 0, 0, 0, 0, 0)
self.gameBoard.setScale(1.0)
self.deck = PairingGameGlobals.createDeck(self.deckSeed, self.numPlayers)
self.notify.debug('%s' % self.deck.cards)
testCard = self.getDeckOrderIndex(self.cardsPerCol - 1, 0)
if not testCard > -1:
self.yCardInc *= 1.25
self.cards = []
for index in xrange(len(self.deck.cards)):
cardValue = self.deck.cards[index]
oneCard = PairingGameCard.PairingGameCard(cardValue)
oneCard.load()
xPos, yPos = self.getCardPos(index)
oneCard.setPos(xPos, yPos, 0)
oneCard.reparentTo(render)
self.notify.debug('%s' % oneCard.getPos())
self.notify.debug('suit %s rank %s value %s' % (oneCard.suit, oneCard.rank, oneCard.value))
self.accept('entercardCollision-%d' % oneCard.value, self.enterCard)
self.accept('exitcardCollision-%d' % oneCard.value, self.exitCard)
oneCard.turnDown(doInterval=False)
self.cards.append(oneCard)
self.bonusTraversal = range(len(self.cards))
self.bonusGlow = render.attachNewNode('bonusGlow')
sign = loader.loadModel('phase_4/models/minigames/garden_sign_memory')
sign.find('**/sign1').removeNode()
sign.find('**/sign2').removeNode()
sign.find('**/collision').removeNode()
sign.setPos(0, 0, 0.05)
sign.reparentTo(self.bonusGlow)
self.bonusGlow.setScale(2.5)
self.pointsFrame = DirectFrame(relief=None, geom=DGG.getDefaultDialogGeom(), geom_color=GlobalDialogColor, geom_scale=(4, 1, 1), pos=(-0.33, 0, 0.9), scale=0.1, text=TTLocalizer.PairingGamePoints, text_align=TextNode.ALeft, text_scale=TTLocalizer.DPGpointsFrame, text_pos=(-1.94, -0.1, 0.0))
self.pointsLabel = DirectLabel(parent=self.pointsFrame, relief=None, text='0', text_fg=VBase4(0, 0.5, 0, 1), text_align=TextNode.ARight, text_scale=0.7, pos=(1.82, 0, -0.15))
self.flipsFrame = DirectFrame(relief=None, geom=DGG.getDefaultDialogGeom(), geom_color=GlobalDialogColor, geom_scale=(4, 1, 1), pos=(0.33, 0, 0.9), scale=0.1, text=TTLocalizer.PairingGameFlips, text_align=TextNode.ALeft, text_scale=TTLocalizer.DPGflipsFrame, text_pos=(-1.94, -0.1, 0.0))
self.flipsLabel = DirectLabel(parent=self.flipsFrame, relief=None, text='0', text_fg=VBase4(0, 1.0, 0, 1), text_align=TextNode.ARight, text_scale=0.7, pos=(1.82, 0, -0.15))
self.__textGen = TextNode('ringGame')
self.__textGen.setFont(ToontownGlobals.getSignFont())
self.__textGen.setAlign(TextNode.ACenter)
self.sndPerfect = base.loadSfx('phase_4/audio/sfx/MG_pairing_all_matched.ogg')
self.calcBonusTraversal()
self.music = base.loadMusic('phase_4/audio/bgm/MG_Pairing.ogg')
self.matchSfx = base.loadSfx('phase_4/audio/sfx/MG_pairing_match.ogg')
self.matchWithBonusSfx = base.loadSfx('phase_4/audio/sfx/MG_pairing_match_bonus_both.ogg')
self.signalSfx = []
for i in range(4):
self.signalSfx.append(base.loadSfx('phase_4/audio/sfx/MG_pairing_jumping_signal.ogg'))
self.bonusMovesSfx = base.loadSfx('phase_4/audio/sfx/MG_pairing_bonus_moves.ogg')
return
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:54,代码来源:DistributedPairingGame.py
示例2: setGameReady
def setGameReady(self):
self.notify.debug('setGameReady')
if self.OneCardInMultiplayer and len(self.avIdList) > 1:
self.maxOpenCards = 1
self.sendUpdate('setMaxOpenCards', [self.maxOpenCards])
DistributedMinigameAI.setGameReady(self)
for avId in self.avIdList:
self.faceUpDict[avId] = []
self.deck = PairingGameGlobals.createDeck(self.deckSeed, self.numPlayers)
for index in xrange(len(self.deck.cards)):
cardValue = self.deck.cards[index]
oneCard = PlayingCardBase(cardValue)
self.cards.append(oneCard)
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:14,代码来源:DistributedPairingGameAI.py
示例3: enterPlay
def enterPlay(self):
self.notify.debug('enterPlay')
def allToonsDone(self = self):
self.notify.debug('allToonsDone')
self.sendUpdate('setEveryoneDone')
if not PairingGameGlobals.EndlessGame:
self.gameOver()
def handleTimeout(avIds, self = self):
self.notify.debug('handleTimeout: avatars %s did not report "done"' % avIds)
self.setGameAbort()
self.gameDuration = PairingGameGlobals.calcGameDuration(self.getDifficulty())
self.doneBarrier = ToonBarrier('waitClientsDone', self.uniqueName('waitClientsDone'), self.avIdList, self.gameDuration + MinigameGlobals.latencyTolerance, allToonsDone, handleTimeout)
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:15,代码来源:DistributedPairingGameAI.py
示例4: updateFlipText
def updateFlipText(self):
self.flipsLabel['text'] = str(self.flips)
lowFlipModifier = PairingGameGlobals.calcLowFlipModifier(self.matches, self.flips)
red = 1.0 - lowFlipModifier
green = lowFlipModifier
self.flipsLabel['text_fg'] = Vec4(red, green, 0, 1.0)
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:6,代码来源:DistributedPairingGame.py
示例5: calcLowFlipBonus
def calcLowFlipBonus(self):
lowFlipModifier = PairingGameGlobals.calcLowFlipModifier(self.matches, self.flips)
bonus = lowFlipModifier * self.matches
self.notify.debug('low flip bonus = %d' % bonus)
return bonus
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:5,代码来源:DistributedPairingGameAI.py
注:本文中的toontown.minigame.PairingGameGlobals类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论