diff options
author | Russell Cohen <rcoh@mit.edu> | 2010-11-25 21:44:00 -0500 |
---|---|---|
committer | Russell Cohen <rcoh@mit.edu> | 2010-11-25 21:44:00 -0500 |
commit | 5783d6336f014c05e0e46d7bc35533e70b280582 (patch) | |
tree | b4e0b0b2787b8fe464baadbd375ad6dc6c1dbf76 /pixelevents | |
parent | b042647b68abdc82490ca6e059993b8eba28904c (diff) |
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.
Diffstat (limited to 'pixelevents')
-rw-r--r-- | pixelevents/DecayEvent.py | 9 |
1 files changed, 7 insertions, 2 deletions
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) |