本文整理汇总了Python中direct.interval.MetaInterval.Parallel类的典型用法代码示例。如果您正苦于以下问题:Python Parallel类的具体用法?Python Parallel怎么用?Python Parallel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Parallel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pieThrow
def pieThrow(self, avId, timestamp, heading, pos, power):
toon = self.activity.getAvatar(avId)
if toon is None:
return
tossTrack, pieTrack, flyPie = self.getTossPieInterval(toon, pos[0], pos[1], pos[2], heading, 0, 0, power)
if avId == base.localAvatar.doId:
flyPie.setTag('throwerId', str(avId))
collSphere = CollisionSphere(0, 0, 0, 0.5)
collSphere.setTangible(0)
name = 'PieSphere-%d' % avId
collSphereName = self.activity.uniqueName(name)
collNode = CollisionNode(collSphereName)
collNode.setFromCollideMask(ToontownGlobals.PieBitmask)
collNode.addSolid(collSphere)
collNP = flyPie.attachNewNode(collNode)
base.cTrav.addCollider(collNP, self.pieHandler)
self.toonPieEventNames[collNP] = 'pieHit-' + collSphereName
self.accept(self.toonPieEventNames[collNP], self.handlePieCollision)
else:
player = self.players.get(avId)
if player is not None:
player.faceForward()
def matchRunningAnim(toon = toon):
toon.playingAnim = None
toon.setSpeed(toon.forwardSpeed, toon.rotateSpeed)
newTossTrack = Sequence(tossTrack, Func(matchRunningAnim))
pieTrack = Parallel(newTossTrack, pieTrack, name='PartyCogActivity.pieTrack-%d-%s' % (avId, timestamp))
elapsedTime = globalClockDelta.localElapsedTime(timestamp)
if elapsedTime < 16.0 / 24.0:
elapsedTime = 16.0 / 24.0
pieTrack.start(elapsedTime)
self.pieIvals.append(pieTrack)
self.toonPieTracks[avId] = pieTrack
示例2: think
def think(self, curTic, curT, unwalkables):
self.TX = self.nextTX
self.TY = self.nextTY
self.lastDirection = self.direction
self.direction = self._MazeSuit__chooseNewWalkDirection(unwalkables)
(self.nextTX, self.nextTY) = self._MazeSuit__applyDirection(self.direction, self.TX, self.TY)
self.occupiedTiles = [
(self.TX, self.TY),
(self.nextTX, self.nextTY)]
if curTic == self.lastTicBeforeRender:
fromCoords = self.maze.tile2world(self.TX, self.TY)
toCoords = self.maze.tile2world(self.nextTX, self.nextTY)
self.fromPos.set(fromCoords[0], fromCoords[1], self.SUIT_Z)
self.toPos.set(toCoords[0], toCoords[1], self.SUIT_Z)
self.moveIval = LerpPosInterval(self.suit, self.cellWalkDuration, self.toPos, startPos = self.fromPos, name = self.uniqueName(self.MOVE_IVAL_NAME))
if self.direction != self.lastDirection:
self.fromH = self.directionHs[self.lastDirection]
toH = self.directionHs[self.direction]
if self.fromH == 270 and toH == 0:
self.fromH = -90
elif self.fromH == 0 and toH == 270:
self.fromH = 360
self.fromHpr.set(self.fromH, 0, 0)
self.toHpr.set(toH, 0, 0)
turnIval = LerpHprInterval(self.suit, self.turnDuration, self.toHpr, startHpr = self.fromHpr, name = self.uniqueName('turnMazeSuit'))
self.moveIval = Parallel(self.moveIval, turnIval, name = self.uniqueName(self.MOVE_IVAL_NAME))
else:
self.suit.setH(self.directionHs[self.direction])
moveStartT = float(self.nextThinkTic) / float(self.ticFreq)
self.moveIval.start(curT - moveStartT + self.gameStartTime)
self.nextThinkTic += self.ticPeriod
示例3: animateArrival
def animateArrival(self):
"""
Cheesy animation introducing viewer to the DESK and TYPEWRITER
:return:
"""
camMoveInterval = LerpPosInterval(self.base.camera, 2, self.cameraTarget)
camHprInterval = LerpHprInterval(self.base.camera, 2, self.cameraHprTarget)
dropKeyboardInterval = LerpPosInterval(self.typewriterNP, 2,
self.typewriterTarget,
startPos=self.typewriterStart,
blendType='easeOut')
sequence = Parallel(camMoveInterval, camHprInterval, dropKeyboardInterval)
sequence.setDoneEvent('arrivalFinished')
def arrivalFinished():
self.activateTypewriter()
self.base.ignore('enter')
self.base.ignore('esc')
self.base.accept('arrivalFinished', arrivalFinished)
sequence.start()
# for the impatient...
def cancelStartupSequence():
sequence.finish()
self.base.acceptOnce('enter', cancelStartupSequence)
self.base.acceptOnce('esc', cancelStartupSequence)
示例4: getIntroTrack
def getIntroTrack(self):
self.__cameraTask(None)
origCamParent = camera.getParent()
origCamPos = camera.getPos()
origCamHpr = camera.getHpr()
iCamParent = base.localAvatar.attachNewNode('iCamParent')
iCamParent.setH(180)
camera.reparentTo(iCamParent)
toonHeight = base.localAvatar.getHeight()
camera.setPos(0, -15, toonHeight * 3)
camera.lookAt(0, 0, toonHeight / 2.0)
iCamParent.wrtReparentTo(origCamParent)
waitDur = 5.0
lerpDur = 4.5
lerpTrack = Parallel()
startHpr = iCamParent.getHpr()
startHpr.setX(PythonUtil.reduceAngle(startHpr[0]))
lerpTrack.append(LerpPosHprInterval(iCamParent, lerpDur, pos=Point3(0, 0, 0), hpr=Point3(0, 0, 0), startHpr=startHpr, name=self.uniqueName('introLerpParent')))
lerpTrack.append(LerpPosHprInterval(camera, lerpDur, pos=origCamPos, hpr=origCamHpr, blendType='easeInOut', name=self.uniqueName('introLerpCameraPos')))
base.localAvatar.startLookAround()
def cleanup(origCamParent = origCamParent, origCamPos = origCamPos, origCamHpr = origCamHpr, iCamParent = iCamParent):
camera.reparentTo(origCamParent)
camera.setPos(origCamPos)
camera.setHpr(origCamHpr)
iCamParent.removeNode()
del iCamParent
base.localAvatar.stopLookAround()
return Sequence(Wait(waitDur),
lerpTrack,
Func(cleanup))
示例5: throwTeamInWater
def throwTeamInWater(self, losingTeam):
self.notify.debug('throwTeamInWater( %s )' % PartyGlobals.TeamActivityTeams.getString(losingTeam))
splashSet = False
for toonId in self.toonIds[losingTeam]:
self.fallenToons.append(toonId)
toon = self.getAvatar(toonId)
fallenPosIndex = self.toonIds[losingTeam].index(toonId)
if fallenPosIndex < 0 or fallenPosIndex >= 4:
fallenPosIndex = 0
newPos = self.fallenPositions[fallenPosIndex]
if self.toonIdsToAnimIntervals.has_key(toonId) and self.toonIdsToAnimIntervals[toonId] is not None:
if self.toonIdsToAnimIntervals[toonId].isPlaying():
self.toonIdsToAnimIntervals[toonId].finish()
if toon:
parallel = Parallel(ActorInterval(actor=toon, animName='slip-forward', duration=2.0), LerpPosInterval(toon, duration=2.0, pos=newPos, other=self.root))
else:
self.notify.warning('toon %d is none, skipping slip-forward' % toonId)
parallel = Parallel()
if not splashSet:
splashSet = True
parallel.append(self.splashInterval)
if toon:
self.toonIdsToAnimIntervals[toonId] = Sequence(parallel, Func(toon.loop, 'neutral'))
else:
self.notify.warning('toon %d is none, skipping toon.loop(neutral)' % toonId)
self.toonIdsToAnimIntervals[toonId] = parallel
self.toonIdsToAnimIntervals[toonId].start()
return
示例6: loadIntervals
def loadIntervals(self):
self.updateIdealRateInterval = Sequence()
self.updateIdealRateInterval.append(Wait(PartyGlobals.TugOfWarTargetRateList[0][0]))
for i in xrange(1, len(PartyGlobals.TugOfWarTargetRateList)):
duration = PartyGlobals.TugOfWarTargetRateList[i][0]
idealRate = PartyGlobals.TugOfWarTargetRateList[i][1]
self.updateIdealRateInterval.append(Func(self.setIdealRate, idealRate))
if i == len(PartyGlobals.TugOfWarTargetRateList) - 1:
self.updateIdealRateInterval.append(Func(setattr, self, "allOutMode", True))
else:
self.updateIdealRateInterval.append(Wait(duration))
self.updateKeyPressRateInterval = Sequence(
Wait(PartyGlobals.TugOfWarKeyPressUpdateRate), Func(self.updateKeyPressRate)
)
self.reportToServerInterval = Sequence(Wait(PartyGlobals.TugOfWarKeyPressReportRate), Func(self.reportToServer))
self.setupInterval = Parallel()
self.globalSetupInterval = Sequence(
Wait(PartyGlobals.TugOfWarReadyDuration + PartyGlobals.TugOfWarGoDuration), Func(self.tightenRopes)
)
self.localSetupInterval = Sequence(
Func(self.setStatus, TTLocalizer.PartyTugOfWarReady),
Func(self.showStatus),
Wait(PartyGlobals.TugOfWarReadyDuration),
Func(base.playSfx, self.whistleSound),
Func(self.setStatus, TTLocalizer.PartyTugOfWarGo),
Wait(PartyGlobals.TugOfWarGoDuration),
Func(self.enableKeys),
Func(self.hideStatus),
Func(self.updateIdealRateInterval.start),
Func(self.updateKeyPressRateInterval.loop),
Func(self.reportToServerInterval.loop),
)
self.splashInterval = Sequence(Func(base.playSfx, self.splashSound), Func(self.splash.play))
示例7: __setViewMode
def __setViewMode(self, mode):
toon = base.localAvatar
if mode == DanceViews.Normal:
if self.cameraParallel is not None:
self.cameraParallel.pause()
self.cameraParallel = None
camera.reparentTo(toon)
base.localAvatar.startUpdateSmartCamera()
elif mode == DanceViews.Dancing:
base.localAvatar.stopUpdateSmartCamera()
camera.wrtReparentTo(self.danceFloor)
node = NodePath('temp')
node.reparentTo(toon.getParent())
node.setPos(Point3(0, -40, 20))
node2 = NodePath('temp2')
node2.reparentTo(self.danceFloor)
node.reparentTo(node2)
node2.setH(render, toon.getParent().getH())
pos = node.getPos(self.danceFloor)
node2.removeNode()
node.removeNode()
self.cameraParallel = Parallel(camera.posInterval(0.5, pos, blendType='easeIn'), camera.hprInterval(0.5, Point3(0, -27, 0), other=toon.getParent(), blendType='easeIn'))
self.cameraParallel.start()
self.currentCameraMode = mode
return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:25,代码来源:DistributedPartyDanceActivityBase.py
示例8: initIntervals
def initIntervals(self):
self.baseSpinDuration = 1.0
self.propellerSpinLerp = LerpFunctionInterval(self.propeller.setH, fromData=0.0, toData=360.0, duration=self.baseSpinDuration, name='%s.propellerSpinLerp-%s' % (self.__class__.__name__, self.toon.doId))
singleBlinkTime = Globals.Gameplay.TargetedWarningSingleBlinkTime
blinkTime = Globals.Gameplay.TargetedWarningBlinkTime
self.blinkLoop = Sequence(Wait(singleBlinkTime / 2.0), Func(self.setBackpackTexture, Globals.Gameplay.BackpackStates.Attacked), Wait(singleBlinkTime / 2.0), Func(self.setBackpackTexture, Globals.Gameplay.BackpackStates.Targeted), name='%s.blinkLoop-%s' % (self.__class__.__name__, self.toon.doId))
self.blinkWarningSeq = Sequence(Func(self.blinkLoop.loop), Wait(blinkTime), Func(self.blinkLoop.clearToInitial), name='%s.blinkWarningSeq-%s' % (self.__class__.__name__, self.toon.doId))
dur = Globals.Gameplay.BackpackRefuelDuration
self.refuelSeq = Sequence(Func(self.setPropellerSpinRate, Globals.Gameplay.RefuelPropSpeed), Wait(dur), Func(self.returnBackpackToLastStateFunc), name='%s.refuelSeq-%s' % (self.__class__.__name__, self.toon.doId))
scale = self.redTapeRing.getScale()
pulseTime = 1.0
self.pulseBubbleSeq = Parallel(Sequence(LerpFunctionInterval(self.redTapeRing.setScale, fromData=scale, toData=scale * 1.1, duration=pulseTime / 2.0, blendType='easeInOut'), LerpFunctionInterval(self.redTapeRing.setScale, fromData=scale * 1.1, toData=scale, duration=pulseTime / 2.0, blendType='easeInOut')), LerpHprInterval(self.redTapeRing, pulseTime, Vec3(360, 0, 0), startHpr=Vec3(0, 0, 0)), name='%s.pulseBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))
bouncePercent = 1.2
scaleTime = 0.5
scaleBounceTime = 0.25
self.popUpBubbleLerp = LerpScaleInterval(self.redTapeRing, scaleTime, scale * bouncePercent, startScale=0.0, blendType='easeInOut')
self.popUpBubbleSeq = Sequence(Func(self.updateLerpStartScale, self.popUpBubbleLerp, self.redTapeRing), Func(self.redTapeRing.show), self.popUpBubbleLerp, LerpScaleInterval(self.redTapeRing, scaleBounceTime, scale, startScale=scale * bouncePercent, blendType='easeInOut'), Func(self.pulseBubbleSeq.loop), name='%s.popUpBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))
self.removeBubbleLerp = LerpScaleInterval(self.redTapeRing, scaleBounceTime, scale * bouncePercent, startScale=scale, blendType='easeInOut')
self.removeBubbleSeq = Sequence(Func(self.pulseBubbleSeq.clearToInitial), Func(self.updateLerpStartScale, self.removeBubbleLerp, self.redTapeRing), self.removeBubbleLerp, LerpScaleInterval(self.redTapeRing, scaleTime, 0.0, startScale=scale * bouncePercent, blendType='easeInOut'), Func(self.redTapeRing.hide), name='%s.removeBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))
self.redTapeRing.setScale(0.0)
self.deathInterval = Sequence(Parallel(LerpHprInterval(self.toon, 1.0, Vec3(720, 0, 0)), LerpFunctionInterval(self.toon.setScale, fromData=1.0, toData=0.1, duration=1.0)), Func(self.toon.stash), name='%s.deathInterval-%s' % (self.__class__.__name__, self.toon.doId))
self.spawnInterval = Sequence(Func(self.toon.stash), Func(self.resetToon), Wait(1.0), Func(self.toon.setAnimState, 'TeleportIn'), Func(self.toon.unstash), name='%s.spawnInterval-%s' % (self.__class__.__name__, self.toon.doId))
singleBlinkTime = Globals.Gameplay.InvulSingleBlinkTime
blinkTime = Globals.Gameplay.InvulBlinkTime
invulBuffTime = Globals.Gameplay.InvulBuffTime
self.blinkBubbleLoop = Sequence(LerpFunctionInterval(self.redTapeRing.setAlphaScale, fromData=1.0, toData=0.0, duration=singleBlinkTime / 2.0, blendType='easeInOut'), LerpFunctionInterval(self.redTapeRing.setAlphaScale, fromData=0.0, toData=1.0, duration=singleBlinkTime / 2.0, blendType='easeInOut'), name='%s.blinkBubbleLoop-%s' % (self.__class__.__name__, self.toon.doId))
self.blinkBubbleSeq = Sequence(Wait(invulBuffTime - blinkTime), Func(self.blinkBubbleLoop.loop), Wait(blinkTime), Func(self.blinkBubbleLoop.finish), name='%s.blinkBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))
示例9: startActive
def startActive(self):
DistributedPartyTeamActivity.startActive(self)
self.toonIdsToStartPositions.clear()
self.toonIdsToIsPullingFlags.clear()
for toonId in self.getToonIdsAsList():
self.toonIdsToIsPullingFlags[toonId] = False
toon = self.getAvatar(toonId)
if toon:
self.toonIdsToStartPositions[toonId] = toon.getPos(self.root)
else:
self.notify.warning("couldn't find toon %d assigning 0,0,0 to startPos" % toonId)
self.toonIdsToStartPositions[toonId] = Point3(0, 0, 0)
self.unusedFallenPositionsIndices = [0,
1,
2,
3]
self.setupInterval = Parallel(self.globalSetupInterval)
if self.isLocalToonPlaying:
self.keyTTL = []
self.idealForce = 0.0
self.keyRate = 0
self.rateMatchAward = 0.0
self.allOutMode = False
self.setIdealRate(PartyGlobals.TugOfWarTargetRateList[0][1])
self.setupInterval.append(self.localSetupInterval)
self.setupInterval.start()
示例10: load
def load(self):
DistributedPartyActivity.load(self)
self.danceFloor = loader.loadModel(self.model)
self.danceFloor.reparentTo(self.getParentNodePath())
self.danceFloor.setPos(self.x, self.y, 0.0)
self.danceFloor.setH(self.h)
self.danceFloor.wrtReparentTo(render)
self.sign.setPos(22, -22, 0)
floor = self.danceFloor.find('**/danceFloor_mesh')
self.danceFloorSequence = Sequence(Wait(0.3), Func(floor.setH, floor, 36))
discoBall = self.danceFloor.find('**/discoBall_mesh')
self.discoBallSequence = Parallel(discoBall.hprInterval(6.0, Vec3(360, 0, 0)), Sequence(discoBall.posInterval(3, Point3(0, 0, 1), blendType='easeInOut'), discoBall.posInterval(3, Point3(0, 0, 0), blendType='easeInOut')))
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:12,代码来源:DistributedPartyDanceActivityBase.py
示例11: enterShowScores
def enterShowScores(self):
self.notify.debug('enterShowScores')
lerpTrack = Parallel()
lerpDur = 0.5
lerpTrack.append(Parallel(LerpPosInterval(self.goalBar, lerpDur, Point3(0, 0, -.6), blendType='easeInOut'), LerpScaleInterval(self.goalBar, lerpDur, Vec3(self.goalBar.getScale()) * 2.0, blendType='easeInOut')))
tY = 0.6
bY = -.05
lX = -.5
cX = 0
rX = 0.5
scorePanelLocs = (((cX, bY),),
((lX, bY), (rX, bY)),
((cX, tY), (lX, bY), (rX, bY)),
((lX, tY),
(rX, tY),
(lX, bY),
(rX, bY)))
scorePanelLocs = scorePanelLocs[self.numPlayers - 1]
for i in xrange(self.numPlayers):
panel = self.scorePanels[i]
pos = scorePanelLocs[i]
lerpTrack.append(Parallel(LerpPosInterval(panel, lerpDur, Point3(pos[0], 0, pos[1]), blendType='easeInOut'), LerpScaleInterval(panel, lerpDur, Vec3(panel.getScale()) * 2.0, blendType='easeInOut')))
self.showScoreTrack = Parallel(lerpTrack, Sequence(Wait(MazeGameGlobals.SHOWSCORES_DURATION), Func(self.gameOver)))
self.showScoreTrack.start()
示例12: enterShowScores
def enterShowScores(self):
self.notify.debug('enterShowScores')
lerpTrack = Parallel()
lerpDur = 0.5
lerpTrack.append(Parallel(LerpPosInterval(self.goalBar, lerpDur, Point3(0, 0, -.6), blendType='easeInOut'), LerpScaleInterval(self.goalBar, lerpDur, Vec3(self.goalBar.getScale()) * 2.0, blendType='easeInOut')))
tY = 0.6
bY = -.05
lX = -.5
cX = 0
rX = 0.5
scorePanelLocs = (((cX, bY),),
((lX, bY), (rX, bY)),
((cX, tY), (lX, bY), (rX, bY)),
((lX, tY),
(rX, tY),
(lX, bY),
(rX, bY)))
scorePanelLocs = scorePanelLocs[self.numPlayers - 1]
for i in xrange(self.numPlayers):
panel = self.scorePanels[i]
pos = scorePanelLocs[i]
panel.wrtReparentTo(aspect2d)
lerpTrack.append(Parallel(LerpPosInterval(panel, lerpDur, Point3(pos[0], 0, pos[1]), blendType='easeInOut'), LerpScaleInterval(panel, lerpDur, Vec3(panel.getScale()) * 2.0, blendType='easeInOut')))
self.showScoreTrack = Parallel(lerpTrack, Sequence(Wait(MazeGameGlobals.SHOWSCORES_DURATION), Func(self.gameOver)))
self.showScoreTrack.start()
#For the Alpha Blueprint ARG
if config.GetBool('want-blueprint4-ARG', False):
MinigameGlobals.generateDebugARGPhrase()
示例13: makeBlendIntervalForBlendingToThisAnimation
def makeBlendIntervalForBlendingToThisAnimation(self, newTransitionAnimation, transitionDuration):
currentlyPlayingAnimationsAndEffectsAndDesiredEffects = []
for animationName in self.skeletonAnimationNames:
if animationName == newTransitionAnimation:
continue
controlEffect = self.getControlEffect(animationName)
if controlEffect > 0.0:
currentlyPlayingAnimationsAndEffectsAndDesiredEffects.append((animationName, controlEffect, 0.0))
continue
currentlyPlayingAnimationsAndEffectsAndDesiredEffects.append((newTransitionAnimation, 0.0, 1.0))
if self.blendInterval:
self.blendInterval.pause()
self.blendInterval.clearToInitial()
self.blendInterval = Sequence(name = '%s_%d.blendInterval' % (self.getName(), self.uniqueCounter))
par = Parallel()
for (animationName, fromData, toData) in currentlyPlayingAnimationsAndEffectsAndDesiredEffects:
par.append(LerpFunctionInterval(self.adjustEffect, duration = transitionDuration, fromData = fromData, toData = toData, extraArgs = [
animationName]))
self.blendInterval.append(par)
示例14: __showSplat
def __showSplat(self, position):
if self.kaboomTrack is not None and self.kaboomTrack.isPlaying():
self.kaboomTrack.finish()
if not self.pieHitSound:
self.notify.warning('Trying to play hit sound on destroyed player')
return
splatName = 'splat-creampie'
self.splat = globalPropPool.getProp(splatName)
self.splat.setBillboardPointEye()
self.splat.reparentTo(render)
self.splat.setPos(self.toon, position)
self.splat.setY(self.toon, bound(self.splat.getY(), self.toon.getHeight() / 2.0, position.getY()))
self.splat.setAlphaScale(1.0)
targetscale = 0.75
def setSplatAlpha(amount):
self.splat.setAlphaScale(amount)
self.kaboomTrack = Parallel(SoundInterval(self.pieHitSound, node=self.toon, volume=1.0, cutOff=PartyGlobals.PARTY_COG_CUTOFF), Sequence(Func(self.splat.showThrough), Parallel(Sequence(LerpScaleInterval(self.splat, duration=0.175, scale=targetscale, startScale=Point3(0.1, 0.1, 0.1), blendType='easeOut'), Wait(0.175)), Sequence(Wait(0.1), LerpFunc(setSplatAlpha, duration=1.0, fromData=1.0, toData=0.0, blendType='easeOut'))), Func(self.splat.cleanup), Func(self.splat.removeNode)))
self.kaboomTrack.start()
return
示例15: __showSplat
def __showSplat(self, position, direction, hot = False):
if self.kaboomTrack is not None and self.kaboomTrack.isPlaying():
self.kaboomTrack.finish()
self.clearHitInterval()
splatName = 'splat-creampie'
self.splat = globalPropPool.getProp(splatName)
self.splat.setBillboardPointEye()
self.splat.reparentTo(render)
self.splat.setPos(self.root, position)
self.splat.setAlphaScale(1.0)
if not direction == 1.0:
self.splat.setColorScale(PartyGlobals.CogActivitySplatColors[0])
if self.currentFacing > 0.0:
facing = 'HitFront'
else:
facing = 'HitBack'
else:
self.splat.setColorScale(PartyGlobals.CogActivitySplatColors[1])
if self.currentFacing > 0.0:
facing = 'HitBack'
else:
facing = 'HitFront'
if hot:
targetscale = 0.75
part = 'head'
else:
targetscale = 0.5
part = 'body'
def setSplatAlpha(amount):
self.splat.setAlphaScale(amount)
self.hitInterval = Sequence(ActorInterval(self.actor, part + facing, loop=0), Func(self.actor.loop, 'idle'))
self.hitInterval.start()
self.kaboomTrack = Parallel(SoundInterval(self.pieHitSound, volume=1.0, node=self.actor, cutOff=PartyGlobals.PARTY_COG_CUTOFF), Sequence(Func(self.splat.showThrough), Parallel(Sequence(LerpScaleInterval(self.splat, duration=0.175, scale=targetscale, startScale=Point3(0.1, 0.1, 0.1), blendType='easeOut'), Wait(0.175)), Sequence(Wait(0.1), LerpFunc(setSplatAlpha, duration=1.0, fromData=1.0, toData=0.0, blendType='easeOut'))), Func(self.splat.cleanup), Func(self.splat.removeNode)))
self.kaboomTrack.start()
return