Exemple #1
0
    def __init__(self):
        super(NewScene, self).__init__()
        
        dimension = (32, 37)
        data = ResourceLoader.load('data//player_run.png')
        sheet = ImageSheet(data, dimension)
        
        interval = 80

        run = [(sheet[i], interval) for i in range(8)]
        
        for i in range(8):
            animation = Animation('run_cycle', run)
            animation.play('run_cycle', i)
            
            staticSprite = Sprite(sheet[i])
            staticSprite.position = (i + 1) * 32 + 16, 84
            self.add(staticSprite)
            
            animatedSprite = Sprite(animation)
            animatedSprite.position = (i + 1) * 32 + 16, 148
            self.add(animatedSprite)