diff options
author | davesilver <nibor123@gmail.com> | 2010-07-27 14:15:36 (GMT) |
---|---|---|
committer | davesilver <nibor123@gmail.com> | 2010-07-27 14:15:36 (GMT) |
commit | b178383661053227d885d2383d9a7ba189f80810 (patch) | |
tree | 284f161be3b55cc8173820d7af81905f1f3a29c7 /devtools/CompleteTestKit | |
parent | d7ce19d938d40a8ad0caddf7b7c9e4bbbd6c1e29 (diff) |
Editing Sprite tests
Diffstat (limited to 'devtools/CompleteTestKit')
-rw-r--r-- | devtools/CompleteTestKit/DynamicDrawableObject2.py | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/devtools/CompleteTestKit/DynamicDrawableObject2.py b/devtools/CompleteTestKit/DynamicDrawableObject2.py index 62b9ac4..1ce8db2 100644 --- a/devtools/CompleteTestKit/DynamicDrawableObject2.py +++ b/devtools/CompleteTestKit/DynamicDrawableObject2.py @@ -49,31 +49,24 @@ class DynamicDrawableObject(DrawableObject, pygame.sprite.Sprite): def update(self, t):
- cnt = 0
- while cnt < len(self.animations):
-
- if self.animations[cnt] == self._current_anim:
-
- timePassed = t + self._last_update
- if timePassed > self._delay:
+ #if self.animations[cnt] == self._current_anim:
+
+ timePassed = t + self._last_update
+ if timePassed > self._delay:
- if self._frame < self.animations.get(self._current_anim)[0] or self._frame > self.animations.get(self._current_anim)[1]: #checking if I am in the animation and putting me there if I am not
+ if self._frame < self.animations.get(self._current_anim)[0] or self._frame > self.animations.get(self._current_anim)[1]: #checking if I am in the animation and putting me there if I am not
- self._frame = self.animations.get(self._current_anim)[0]
+ self._frame = self.animations.get(self._current_anim)[0]
- self._frame += timePassed/self._delay
- while self._frame >= self.animations.get(self._current_anim)[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]
+ framesPast = self._frame - self.animations.get(self._current_anim)[1]
+ self._frame = framesPast - 1 + self.animations.get(self._current_anim)[0]
- self.image = self._images[self._frame]
- self._last_update = timePassed%self._delay
- self._last_update = timePassed
-
- cnt = len(self.animations)
-
- cnt += 1
+ self.image = self._images[self._frame]
+ self._last_update = timePassed%self._delay
+ self._last_update = timePassed
def nextFrame(self):
|