Startpoint widget implemented

This commit is contained in:
Mal
2020-02-04 23:03:33 +01:00
parent d46b195269
commit fa648ae730
12 changed files with 231 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ export default class Field
{
this.tileset = tileset;
this.index = index;
this.isEntrancePoint = false;
this.initHtml();
this.initEventListeners();
}
@@ -63,6 +64,17 @@ export default class Field
this.htmlElement.style.backgroundPositionX = -this.index * this.tileset.getTileWidth() + 'px';
}
setEntrancePoint(bool)
{
this.isEntrancePoint = bool;
if (this.isEntrancePoint) {
this.htmlElement.classList.add('entrance');
} else {
this.htmlElement.classList.remove('entrance');
}
}
getElement()
{
return this.htmlElement;