package de.frajul.endlessroll.entities;

import de.frajul.endlessroll.data.Vector;
import de.frajul.endlessroll.entities.textures.Texture;
import de.frajul.endlessroll.main.game.Timer;

/**
 * Created by Julian on 20.02.2017.
 */

public class AnimatedEntity extends Entity {

    protected Animation animation;

    public AnimatedEntity(Texture texture, Vector position, float width, float height) {
        super(texture, position, width, height);
        animation = new Animation();
    }

    public void update(Timer timer){
        animation.update(timer);
        super.setTextureAtlasIndex(animation.getCurrentTexIndex());
    }

}
