diff pytouhou/game/sprite.py @ 280:e04c3e1957c8

Fix ANM interpolators.
author Thibaut Girka <thib@sitedethib.com>
date Wed, 08 Feb 2012 19:56:56 +0100
parents d3ba32a9096e
children f3099ebf4f61
line wrap: on
line diff
--- a/pytouhou/game/sprite.py
+++ b/pytouhou/game/sprite.py
@@ -61,24 +61,21 @@ class Sprite(object):
 
 
     def fade(self, duration, alpha, formula):
-        if not self.fade_interpolator:
-            self.fade_interpolator = Interpolator((self.alpha,), self.frame,
-                                                  (alpha,), self.frame + duration,
-                                                  formula)
+        self.fade_interpolator = Interpolator((self.alpha,), self.frame,
+                                              (alpha,), self.frame + duration,
+                                              formula)
 
 
     def scale_in(self, duration, sx, sy, formula):
-        if not self.scale_interpolator:
-            self.scale_interpolator = Interpolator(self.rescale, self.frame,
-                                                   (sx, sy), self.frame + duration,
-                                                   formula)
+        self.scale_interpolator = Interpolator(self.rescale, self.frame,
+                                               (sx, sy), self.frame + duration,
+                                               formula)
 
 
     def move_in(self, duration, x, y, z, formula):
-        if not self.offset_interpolator:
-            self.offset_interpolator = Interpolator(self.dest_offset, self.frame,
-                                                    (x, y, z), self.frame + duration,
-                                                    formula)
+        self.offset_interpolator = Interpolator(self.dest_offset, self.frame,
+                                                (x, y, z), self.frame + duration,
+                                                formula)
 
 
     def update_orientation(self, angle_base=0., force_rotation=False):