File size: 630 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
import tile from './tile';
import * as CONST from '../../constants';

export default class pipe extends tile {
  constructor (options) {
    options.type = CONST.T_PIPE;
    options.layerDepth = CONST.DEPTH_PIPE;
    super(options);
  }

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

    if (![334,335,336,337,338,339,340,341,342,343,344,345,346,347,
      348,349,350,351,451,452,453,454,455,456,457,458,459,460,
      461,462,463,464,465,466,467].includes(this.id))
      return false;

    return true;
  }

  create () {
    super.create();

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