Factor out AnimatableTile{Factory}

This commit is contained in:
Ian Gulliver
2021-05-11 05:28:20 +00:00
parent 4e65819183
commit 8f76317ccc
16 changed files with 80 additions and 51 deletions

17
js/animatable_tile.js Normal file
View File

@@ -0,0 +1,17 @@
import { Tile } from './tile.js';
export class AnimatableTile extends Tile {
constructor(width, height, animations) {
super(width, height);
this.animations = animations;
}
play(name) {
const animation = this.animations.get(name);
if (animation) {
return this.elem.animate(...animation);
}
else {
return undefined;
}
}
}
//# sourceMappingURL=animatable_tile.js.map