Files
tower/js/simple_tile.js

16 lines
535 B
JavaScript
Raw Normal View History

2021-05-11 02:57:17 +00:00
import { Tile } from './tile.js';
export class SimpleTile extends Tile {
constructor(width, height, image_url, animations) {
super(width, height);
this.elem.style.backgroundImage = `url('${encodeURIComponent(image_url)}')`;
this.elem.style.backgroundSize = 'cover';
this.animations = animations;
}
2021-05-11 03:12:32 +00:00
play(name) {
const animation = this.animations.get(name);
if (animation) {
this.elem.animate(...animation);
}
}
2021-05-11 02:57:17 +00:00
}
//# sourceMappingURL=simple_tile.js.map