From 5783d6336f014c05e0e46d7bc35533e70b280582 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 25 Nov 2010 21:44:00 -0500 Subject: Added BehaviorChain to support chains of behaviors. Added FollowMouse parameter to PygameInput to support following of mice. Added component registry to Util which allows any component to access any other component. Some changes to the structure of LightInstallation. --- pixelevents/DecayEvent.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pixelevents') diff --git a/pixelevents/DecayEvent.py b/pixelevents/DecayEvent.py index c9fc226..01255be 100644 --- a/pixelevents/DecayEvent.py +++ b/pixelevents/DecayEvent.py @@ -1,4 +1,4 @@ -from pixelcore import PixelEvent +from operationscore.PixelEvent import * import Util, math class DecayEvent(PixelEvent): def initEvent(self): @@ -9,4 +9,9 @@ class DecayEvent(PixelEvent): decay = math.exp(timeDelay*-1*self['Coefficient']) if self['DecayType'] == 'Proportional': decay = float(self['Coefficient']) / timeDelay - return Util.multiplyColor(self['Color'], decay) + color = Util.multiplyColor(self['Color'], decay) + return color if sum(color) > 5 else None + @staticmethod + def generate(decayType, coefficient, color): + args = {'DecayType': decayType, 'Coefficient':coefficient, 'Color':color} + return DecayEvent(args) -- cgit v1.2.3