Walkable mask painting

This commit is contained in:
Ian Gulliver
2021-05-17 04:26:18 +00:00
parent 0030b63e3a
commit 9d681291cc
43 changed files with 577 additions and 362 deletions

View File

@@ -6,7 +6,7 @@ export class SimpleTileFactory extends AnimatableTileFactory {
this.name = name;
}
build(tileset) {
return new SimpleTile(this.width, this.height, `images/${this.name.replace('{tileset}', tileset)}`, this.animations);
return new SimpleTile(...this.animatable_tile_args(), `images/${this.name.replace('{tileset}', tileset)}`);
}
copy() {
const stf = new SimpleTileFactory(this.layer_name, this.width, this.height, this.name);
@@ -16,28 +16,4 @@ export class SimpleTileFactory extends AnimatableTileFactory {
return stf;
}
}
/*
function string_to_mask(mask_string: string): boolean[][] {
// mask_string: '\n+++\n+++\n'
const rows = mask_string.trim().split('\n');
// rows: ['+++', '+++']
const mask = [];
for (let x = 0; x < rows[0].length; x++) {
mask[x] = Array(rows.length);
}
// mask: [ [ empty, empty ], [ empty, empty ], [ empty, empty ] ]
for (let y = 0; y < rows.length; y++) {
const row = rows[y];
for (let x = 0; x < row.length; x++) {
const cell = row[x];
mask[x][y] = (cell.toUpperCase() == 'X');
}
}
return mask;
}
*/
//# sourceMappingURL=simple_tile_factory.js.map