Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devtools/CompleteTestKit
diff options
context:
space:
mode:
authordavesilver <nibor123@gmail.com>2010-07-27 15:06:43 (GMT)
committer davesilver <nibor123@gmail.com>2010-07-27 15:06:43 (GMT)
commitc7abe0e8597eac6348e0696e2dc01dd1654d1d53 (patch)
tree0b54a0d1d97507e7771daa2be7da66aecad5189e /devtools/CompleteTestKit
parent287da47e1021552028325fac78f58009d6250f6f (diff)
Editing Sprite tests
Diffstat (limited to 'devtools/CompleteTestKit')
-rw-r--r--devtools/CompleteTestKit/DynamicDrawableObject2.py2
-rw-r--r--devtools/CompleteTestKit/dirtyTest2.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/devtools/CompleteTestKit/DynamicDrawableObject2.py b/devtools/CompleteTestKit/DynamicDrawableObject2.py
index 5cef231..5a180ac 100644
--- a/devtools/CompleteTestKit/DynamicDrawableObject2.py
+++ b/devtools/CompleteTestKit/DynamicDrawableObject2.py
@@ -54,7 +54,7 @@ class DynamicDrawableObject(DrawableObject, pygame.sprite.Sprite):
print self._delay
timePassed = t + self._last_update
print timePassed
- if (1000 * timePassed) > self._delay:
+ if (timePassed) > self._delay:
print "yes"
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]
diff --git a/devtools/CompleteTestKit/dirtyTest2.py b/devtools/CompleteTestKit/dirtyTest2.py
index 7cad73b..ebed198 100644
--- a/devtools/CompleteTestKit/dirtyTest2.py
+++ b/devtools/CompleteTestKit/dirtyTest2.py
@@ -75,16 +75,17 @@ for aTrial in range(maxTrial):
print " -- Time to load"
+ clock = pygame.time.Clock()
+ clock.tick()
start = time()
- other = time()
for frame in range(FRAME):
dirtyList=[]
for image in range(numImages):
#move / collision detection
- groups[image].update(time() - other)
+ groups[image].update(clock.getTime())
+ clock.tick()
#individually blit each image group - add to list for update
dirtyList.extend(groups[image].draw(screen))
- other = time()
#draw the images flip/update
pygame.display.update(dirtyList)