mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Intelligent graphic sets implemented
This commit is contained in:
@@ -10,6 +10,7 @@ export default class Tileset
|
||||
this.image.src = '../' + Setting.TILESET_LOCATION + GraphicSet[this.setId].tileset;
|
||||
this.tiles = GraphicSet[this.setId].tiles;
|
||||
this.scale = GraphicSet[this.setId].scale;
|
||||
this.primaryTiles = GraphicSet[this.setId].primaryTiles;
|
||||
}
|
||||
|
||||
getWidth()
|
||||
@@ -31,4 +32,16 @@ export default class Tileset
|
||||
{
|
||||
return this.image.height * this.scale;
|
||||
}
|
||||
|
||||
hasExtendedTiles()
|
||||
{
|
||||
return GraphicSet[this.setId].tiles > GraphicSet[this.setId].primaryTiles ;
|
||||
}
|
||||
|
||||
getTileIndexFactor(code)
|
||||
{
|
||||
const CODES = ['ltr', 't', 'r', 'b', 'l', 'lt', 'tr', 'ltb', 'tb', 'trb', 'lb', 'rb', 'ltrb', 'lr', 'lrb'];
|
||||
|
||||
return CODES.indexOf(code) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user