Working animations

This commit is contained in:
Ian Gulliver
2021-05-11 03:12:32 +00:00
parent 0ff24fe806
commit ea167e42a1
17 changed files with 74 additions and 37 deletions

View File

@@ -1,3 +1,4 @@
import { Tile } from './tile.js';
import { TileFactory } from './tile_factory.js';
export class Layer {
@@ -12,9 +13,9 @@ export class Layer {
this.#tileset = tileset;
}
add_tile(tile_factory: TileFactory): HTMLElement {
const elem = tile_factory.build(this.#tileset).get_elem();
elem.style.zIndex = `${this.#level}`;
return elem;
add_tile(tile_factory: TileFactory): Tile {
const tile = tile_factory.build(this.#tileset);
tile.get_elem().style.zIndex = `${this.#level}`;
return tile;
}
}