File size: 764 Bytes
4ee4376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import tile from './tile';
import * as CONST from '../../constants';

export default class underground extends tile {
  constructor (options) {
    options.type = CONST.T_UNDERGROUND;
    options.layerDepth = CONST.DEPTH_UNDERGROUND;
    super(options);
  }

  check () {
    if (!super.check()) return false;

    if (![305,306,307,308,309,310,311,312,313,314,315,316,317,318].includes(this.id)) return false;

    return true;
  }

  position () {
    this.x = this.cell.position.topLeft.x - (this.tile.width / 2) << 0;
    this.y = this.cell.position.topLeft.y - (this.tile.height) - this.offset << 0;
    this.depth = this.cell.depth || 0;
  }
  
  create () {
    super.create();

    if (this.sprite) this.sprite.setVisible(false); // hidden by default
  }
}