Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/MAFH2
diff options
context:
space:
mode:
authorslm <jtmengel@gmail.com>2010-08-05 18:17:25 (GMT)
committer slm <jtmengel@gmail.com>2010-08-05 18:17:25 (GMT)
commit04334feb88aa124afca62dec8f4f742539c90e3e (patch)
treeabbdd8e8f802be85a2ba834d7ddd4566d608d884 /MAFH2
parentebacb5b81ce97c0d0a8643da1bf6903935be5c08 (diff)
Fixed a lag issue in the DynamicDrawableObject when it reaches the final frame in a set of animation frames.
Diffstat (limited to 'MAFH2')
-rw-r--r--MAFH2/fortuneengine/DynamicDrawableObject.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/MAFH2/fortuneengine/DynamicDrawableObject.py b/MAFH2/fortuneengine/DynamicDrawableObject.py
index 0d8136d..7dcb831d 100644
--- a/MAFH2/fortuneengine/DynamicDrawableObject.py
+++ b/MAFH2/fortuneengine/DynamicDrawableObject.py
@@ -40,11 +40,10 @@ class DynamicDrawableObject(DrawableObject, pygame.sprite.Sprite):
self._frame = self.animations.get(self._current_anim)[0] - 1
self._frame += timePassed/self._delay
-
- while self._frame >= self.animations.get(self._current_anim)[1]:
- framesPast = self._frame - self.animations.get(self._current_anim)[1]
- self._frame = framesPast - 1 + self.animations.get(self._current_anim)[0]
-
+
+ if self._frame >= self.animations.get(self._current_anim)[1]:
+ self._frame = self._frame%(self.animations.get(self._current_anim)[1])
+
self.image = self._images[self._frame]
self._last_update = timePassed%self._delay
else: