Walkable mask painting
This commit is contained in:
10
ts/tile.ts
10
ts/tile.ts
@@ -1,10 +1,18 @@
|
||||
import { Mask } from './mask.js';
|
||||
|
||||
export abstract class Tile {
|
||||
elem: HTMLElement;
|
||||
masks: Map<string, Mask>;
|
||||
|
||||
constructor(width: number, height: number, masks: Map<string, Mask>) {
|
||||
this.masks = masks;
|
||||
|
||||
constructor(width: number, height: number) {
|
||||
this.elem = document.createElement('div');
|
||||
this.elem.style.gridColumnEnd = `span ${width}`;
|
||||
this.elem.style.gridRowEnd = `span ${height}`;
|
||||
// Hack to avoid floating point stitching gaps
|
||||
this.elem.style.width = 'calc(100% + 1px)';
|
||||
this.elem.style.height = 'calc(100% + 1px)';
|
||||
}
|
||||
|
||||
abstract play(name: string): Animation | undefined;
|
||||
|
||||
Reference in New Issue
Block a user