mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Io graphics set added
This commit is contained in:
@@ -53,12 +53,12 @@ export default class Terrain
|
||||
|
||||
getWidth()
|
||||
{
|
||||
return this.tilesX * this.tilest.getTileWidth();
|
||||
return this.tilesX * this.tileset.getTileWidth();
|
||||
}
|
||||
|
||||
getHeight()
|
||||
{
|
||||
return this.tilesY * this.tilest.getTileHeight();
|
||||
return this.tilesY * this.tileset.getTileHeight();
|
||||
}
|
||||
|
||||
addRows(index, quantity = 1)
|
||||
@@ -70,6 +70,14 @@ export default class Terrain
|
||||
this.targetTileY = this.targetTileY === undefined ? undefined : this.targetTileY + 1;
|
||||
}
|
||||
|
||||
for (let y = index; y < this.tilesY; y++) {
|
||||
for (let x = 0; x < this.tilesX; x++) {
|
||||
// this.fields[y][x].index += quantity;
|
||||
console.log(x, y);
|
||||
this.fields[y][x].y += quantity;
|
||||
}
|
||||
}
|
||||
|
||||
this.htmlElement.style.height = this.tileset.getTileHeight() * this.tilesY + 'px';
|
||||
}
|
||||
|
||||
@@ -98,6 +106,8 @@ export default class Terrain
|
||||
|
||||
addColumns(index, quantity = 1)
|
||||
{
|
||||
console.log(this.fields);
|
||||
|
||||
for (let c = 0; c < quantity; c++) {
|
||||
this._insertColumn(index);
|
||||
this.tilesX++;
|
||||
@@ -105,7 +115,15 @@ export default class Terrain
|
||||
this.targetTileX = this.targetTileX === undefined ? undefined : this.targetTileX + 1;
|
||||
}
|
||||
|
||||
for (let y = 0; y < this.tilesY; y++) {
|
||||
for (let x = index; x < this.tilesX; x++) {
|
||||
this.fields[y][x].x += quantity;
|
||||
}
|
||||
}
|
||||
|
||||
this.htmlElement.style.width = this.tileset.getTileWidth() * this.tilesX + 'px';
|
||||
|
||||
console.log(this.fields);
|
||||
}
|
||||
|
||||
_insertColumn(index = undefined)
|
||||
@@ -233,6 +251,8 @@ export default class Terrain
|
||||
return true;
|
||||
}
|
||||
|
||||
console.log(x, y);
|
||||
|
||||
return this.fields[y][x].index > -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user