changeset 280:e04c3e1957c8

Fix ANM interpolators.
author Thibaut Girka <thib@sitedethib.com>
date Wed, 08 Feb 2012 19:56:56 +0100
parents 3539520fff93
children 13dcde917083
files pytouhou/game/lasertype.py pytouhou/game/sprite.py
diffstat 2 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/lasertype.py
+++ b/pytouhou/game/lasertype.py
@@ -1,4 +1,6 @@
 class LaserType(object):
-    def __init__(self, anm_wrapper, anim_index):
+    def __init__(self, anm_wrapper, anim_index,
+                 launch_anim_offsets=(0, 1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 5, 6, 6, 6, 0)):
         self.anm_wrapper = anm_wrapper
         self.anim_index = anim_index
+        self.launch_anim_offsets = launch_anim_offsets
--- 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):