Compare commits

..

No commits in common. "e0f93e4017235220810b87d9eeca7b3adb605838" and "fc990c12aaeb3716017a23cdee0acdf6f63b2101" have entirely different histories.

5 changed files with 3 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -83,7 +83,7 @@ const GraphicSet = [
gravity: 9.806,
tilesetBackground: {
path: 'graveyard-background.png',
tiles: 5,
tiles: 2,
scale: 1,
}
}

View File

@ -77,7 +77,7 @@ export default class Field
{
const position = this.index >= -1
? -this.index * this.tileset.getTileWidth()
: ((this.index + 2) % this.tileset.background.tiles) * this.tileset.getTileWidth();
: (this.index % this.tileset.background.tiles) * this.tileset.getTileWidth();
this.htmlElement.style.backgroundPositionX = String(position) + 'px';
}

View File

@ -141,7 +141,6 @@ export default class Tilorswift
} else {
document.body.style.backgroundImage = 'none';
}
this.map.innerHTML = '';
this.map.appendChild(this.level.terrain.getElement());
this.tilesetPicker.reloadTileset(this.tileset);

View File

@ -31,13 +31,10 @@ export default class BackgroundPickerWidget extends Widget
loadTileset()
{
if (this.tileset.background === null) {
this.disable();
this.htmlElement.style.backgroundImage = 'none';
return;
}
this.enable();
for (let t = -2; t >= -this.tileset.background.tiles - 1; t--) {
console.log(t);
const button = new ButtonBackgroundTile(this.tileset, t);
@ -82,7 +79,7 @@ export default class BackgroundPickerWidget extends Widget
setTile(index)
{
this.htmlElement.style.backgroundPosition = String(((index + 2) % this.tileset.background.tiles) * this.tileset.getTileWidth()) + 'px ' + String(this.tileset.getTileHeight()) + 'px';
this.htmlElement.style.backgroundPosition = String(-this.tileset.getTileWidth() * index) + 'px ' + String(this.tileset.getTileHeight()) + 'px';
}
getElement()