Walkable mask painting
This commit is contained in:
@@ -11,10 +11,8 @@ export class SimpleTileFactory extends AnimatableTileFactory {
|
||||
|
||||
build(tileset: string): SimpleTile {
|
||||
return new SimpleTile(
|
||||
this.width,
|
||||
this.height,
|
||||
...this.animatable_tile_args(),
|
||||
`images/${this.name.replace('{tileset}', tileset)}`,
|
||||
this.animations,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,28 +24,3 @@ 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;
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user