|
@@ -15,6 +15,8 @@ export default class Train {
|
15
|
15
|
public color: tinycolorInstance;
|
16
|
16
|
public sprite: PIXI.Sprite;
|
17
|
17
|
|
|
18
|
+ private textStyle: object;
|
|
19
|
+
|
18
|
20
|
constructor(
|
19
|
21
|
location: PIXI.Point,
|
20
|
22
|
speed: number,
|
|
@@ -35,15 +37,20 @@ export default class Train {
|
35
|
37
|
// for debugging
|
36
|
38
|
trainCount += 1;
|
37
|
39
|
this.id = trainCount;
|
38
|
|
- this.label = new PIXI.Text(`${this.id}`, {
|
|
40
|
+ this.textStyle = {
|
39
|
41
|
fill: '#AEAEAE',
|
40
|
42
|
fontFamily: 'monospace',
|
41
|
43
|
fontSize: '12px',
|
42
|
|
- });
|
|
44
|
+ };
|
|
45
|
+ this.renderLabel();
|
43
|
46
|
}
|
44
|
47
|
|
45
|
48
|
public boardPassengers() {
|
46
|
49
|
if (this.location === this.origin.location) { // about to leave a station
|
47
|
50
|
}
|
48
|
51
|
}
|
|
52
|
+
|
|
53
|
+ public renderLabel() {
|
|
54
|
+ this.label = new PIXI.Text(`${this.id}`, this.textStyle);
|
|
55
|
+ }
|
49
|
56
|
}
|