class Animation {
    sequence = [];
    fps = 12;

    _sprites = [];

    addSprite(spriteName) {
        this._sprites.push(spriteName);
    }

    getSprite(time) {
        const index = Math.floor((this.fps * time) % this.sequence.length);
        const sprite = this._sprites[this.sequence[index]];
        if (!sprite)
            console.error("Oh no.");
        return sprite;
    }
}