blob: 6486eb2b47650495a64330462bf23b3daf44ec98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)
|