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

@@ -53,12 +53,13 @@ export class Grid {
}
}
add_tile(layer, tile_factory, x, y) {
const elem = __classPrivateFieldGet(this, _layers).get(layer).add_tile(tile_factory);
const tile = __classPrivateFieldGet(this, _layers).get(layer).add_tile(tile_factory);
const elem = tile.get_elem();
// Grids are 1-indexed
elem.style.gridColumnStart = `${x + 1}`;
elem.style.gridRowStart = `${y + 1}`;
__classPrivateFieldGet(this, _prnt).appendChild(elem);
return true;
return tile;
}
}
_prnt = new WeakMap(), _tileset = new WeakMap(), _layers = new WeakMap();