function update(game: Game, entity: Entity, delta: number) {
let animate = game.World.AnimateSprite[entity];
for (let frame_name in animate.Frames) {
let frame_timestamp = animate.Frames[frame_name];
if (animate.Time < frame_timestamp) {
set_sprite(game, entity, frame_name);
break;
}
}
animate.Time += delta;
if (animate.Time >= animate.Duration) {
animate.Time -= animate.Duration;
}
}