Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/anim/DrawableObjectTests/StaticDrawableObject.py
diff options
context:
space:
mode:
authorslm <jtmengel@gmail.com>2010-08-05 18:21:45 (GMT)
committer slm <jtmengel@gmail.com>2010-08-05 18:21:45 (GMT)
commit725c625e6f129e7972177483b59295e9e3d8b0a9 (patch)
tree0e7c72bb56b5695acc7faeac18b5af9ca64f0dec /anim/DrawableObjectTests/StaticDrawableObject.py
parent04334feb88aa124afca62dec8f4f742539c90e3e (diff)
Added files which I had previously forgotten to add
Diffstat (limited to 'anim/DrawableObjectTests/StaticDrawableObject.py')
-rwxr-xr-xanim/DrawableObjectTests/StaticDrawableObject.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/anim/DrawableObjectTests/StaticDrawableObject.py b/anim/DrawableObjectTests/StaticDrawableObject.py
new file mode 100755
index 0000000..6486eb2
--- /dev/null
+++ b/anim/DrawableObjectTests/StaticDrawableObject.py
@@ -0,0 +1,32 @@
+import pygame
+from DrawableObject import DrawableObject
+
+class StaticDrawableObject(pygame.sprite.Sprite):
+
+ def __init __(self,images,textfileName,fps = 10):
+ pygame.sprite.Sprite.__init__(self)
+ self._images = images
+
+ self._start = pygame.time.get_ticks()
+ self._delay = 1000 / fps
+ self._last_update = 0
+ self._frame = 0
+ self.animations = {}
+
+ if textfileName != '':
+
+ f = open(textfileName, 'r')
+ currentLine = f.readline()
+ while currentLine != '':
+
+ animValues = currentLine.split(",")
+ self.animations[animValues[0]] = [int(animValues[1]), int(animValues[2])]
+ currentLine = f.readline()
+
+
+ def addImages(self, images):
+
+ self._images.extend(images)
+
+
+