Dialogs and function for new terrain.

This commit is contained in:
Mal
2020-02-10 19:36:46 +01:00
parent f6890eec24
commit b58cb552c8
7 changed files with 79 additions and 7 deletions

View File

@@ -21,7 +21,13 @@ export default class RetroArchitecture
init()
{
for (let y = 0; y < this.rows; y++) {
this.matrix.push(Array(this.columns).fill(null));
let row = [];
for (let x = 0; x < this.columns; x++) {
row.push(null);
}
console.log(row);
this.matrix.push(row);
}
}
@@ -151,7 +157,7 @@ export default class RetroArchitecture
for (let x = viewX; x < viewWidth; x++) {
let field = this.matrix[y][x];
if (field !== null) {
if (field !== null && field !== undefined) {
context.drawImage(
this.tileset.canvas,
field.tile * this.tileWidth,