diff pytouhou/game/effect.py @ 328:56523a16db1d

Fix some replay synchronization issues and update the TODO.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 21 Jun 2012 19:59:41 +0200
parents f3099ebf4f61
children bdcf2077e368
line wrap: on
line diff
--- a/pytouhou/game/effect.py
+++ b/pytouhou/game/effect.py
@@ -57,6 +57,7 @@ class Particle(object):
         self.pos_interpolator = None
         self.scale_interpolator = None
         self.rotations_interpolator = None
+        self.alpha_interpolator = None
 
         self.amp = amp
 
@@ -71,6 +72,8 @@ class Particle(object):
                                                (0., 0.), 24)
         self.rotations_interpolator = Interpolator(self.sprite.rotations_3d, 0,
                                                    (0., 0., 2*pi), 24)
+        self.alpha_interpolator = Interpolator((self.sprite.alpha,), 0,
+                                               (0.,), 24)
 
 
     def update(self):
@@ -87,6 +90,9 @@ class Particle(object):
             self.rotations_interpolator.update(self.frame)
             self.sprite.rotations_3d = self.rotations_interpolator.values
 
+            self.alpha_interpolator.update(self.frame)
+            self.sprite.alpha, = self.alpha_interpolator.values
+
             self.sprite.changed = True
 
         if self.frame == 24: