def IncreaseOilTotal (self, dur, amount): self.SOUNDS['oil'].loop(viz.ON) self.SOUNDS['oil'].play() score = int(self._score.getMessage()) oil = int(self._oil.getMessage()) total = int(self._total.getMessage()) oilCounter = vizact.mix(oil, oil+amount, time=dur) totalCounter = vizact.mix(total, total+score*amount, time=dur) self._total.addAction(vizact.call(self.CounterIncrease, self._total, totalCounter)) self._oil.addAction(vizact.call(self.CounterIncrease, self._oil, oilCounter)) self._oil.addAction(vizact.call(self.CounterSoundStop))
def FallAction(): """Flashes screen red and animates blur effect""" flash_quad.visible(True) flash_quad.color(viz.RED) fade_out = vizact.fadeTo(viz.BLACK,time=2.5) flash_quad.runAction(vizact.sequence(fade_out,vizact.method.visible(False))) flash_quad.runAction(vizact.call(blurEffect.setDistance,vizact.mix(50,0,time=2.5)),pool=1)
def FadeToGrayTask(): gray_effect.setBlend(0.0) gray_effect.setEnabled(True) yield viztask.waitCall(gray_effect.setBlend,vizact.mix(0.0,1.0,time=1.0))
def FadeToGrayTask(): gray_effect.setBlend(1) gray_effect.setEnabled(True) yield viztask.waitCall(gray_effect.setBlend, vizact.mix(viz.BLACK, viz.WHITE, time=1.0))
def BlurTask(): blur_effect.setBlend(0.0) blur_effect.setEnabled(True) yield viztask.waitCall(blur_effect.setBlend, vizact.mix(0.0, 1.0, time=3.0)) blur_effect.setEnabled(False)
def FadeToGrayTask(): gray_effect.setBlend(0.0) gray_effect.setEnabled(True) yield viztask.waitCall(gray_effect.setBlend, vizact.mix(0.0, 1.0, time=1.0))