Skip to content

Commit 13ded52

Browse files
committed
New Tile class to be shared across static and dynamic layers
1 parent 3f08689 commit 13ded52

2 files changed

Lines changed: 13 additions & 59 deletions

File tree

v3/src/gameobjects/tilemap/Tile.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
var Class = require('../../utils/Class');
2-
3-
// Dummy Tile class
4-
// Todo: merge dynamic/tile into this
2+
var Components = require('../components');
53

64
var Tile = new Class({
75

6+
// TODO: Add in bounds mixin, or custom replacement
7+
Mixins: [
8+
Components.Alpha,
9+
Components.Flip,
10+
Components.Visible
11+
],
12+
813
initialize:
914

1015
function Tile (layer, index, x, y, width, height)
@@ -13,10 +18,14 @@ var Tile = new Class({
1318
this.index = index;
1419
this.x = x;
1520
this.y = y;
21+
this.worldX = x * width;
22+
this.worldY = y * height;
1623
this.width = width;
1724
this.height = height;
18-
}
1925

26+
// TODO: update renders to allow for using Components.Tint
27+
this.tint = 0xFFFFFF;
28+
}
2029
});
2130

2231
module.exports = Tile;

v3/src/gameobjects/tilemap/dynamiclayer/Tile.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)