mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Startpoint widget implemented
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user