Esempio n. 1
0
    def __init__(self, fnames, pos):
        game.Game.__init__(self)

        strips = cyclic_list_func([])
        y = 0
        for i, fname in enumerate(fnames):
            if "colorkey" in fname:
                colorkey=-1
            else:
                colorkey=None
            #pos = (50*i, y)

            # get the width out of the filename.
            parts = fname.split(".")
            try:
                width = int(parts[-2].split('-')[-1])
            except:
                width = 50
            strips.append( Strip(fname, width, colorkey, pos=pos, loop=-1) )

        self.pos = pos
        self.strips = strips
        self.strip = self.strips[0]

        self.world = vec2d(0,0)
Esempio n. 2
0
 def set_music_tracks(self, music_tracks):
     ''' music_tracks([]) loops over the given music tracks.
     '''
     if not hasattr(self, 'music_tracks'):
         self.music_tracks = cyclic_list_func(music_tracks)