Add: AlienTimer
This commit is contained in:
@@ -10,6 +10,9 @@ class Alien extends Phaser.Sprite {
|
||||
this.initialX = initialX;
|
||||
this.initialY = initialY;
|
||||
|
||||
this.tweenScaleUp = null;
|
||||
this.tweenScaleDown = null;
|
||||
|
||||
this.onGoOnstageFunction = onGoOnstageFunction;
|
||||
this.onFiredFunction = onFiredFunction;
|
||||
this.onEscapedFunction = onEscapedFunction;
|
||||
@@ -55,6 +58,14 @@ class Alien extends Phaser.Sprite {
|
||||
}
|
||||
|
||||
|
||||
stop() {
|
||||
this.setActive(false);
|
||||
this.removeTween();
|
||||
|
||||
// if(this.isOnWaitingRoom !== true)
|
||||
// this.scale.set(0);
|
||||
}
|
||||
|
||||
setActive(isActivated) {
|
||||
this.isActivated = isActivated;
|
||||
|
||||
@@ -66,16 +77,14 @@ class Alien extends Phaser.Sprite {
|
||||
}
|
||||
|
||||
removeTween() {
|
||||
if(typeof this.tweenScaleUp !== "undefined") {
|
||||
if(this.tweenScaleUp !== null) {
|
||||
this.tweenScaleUp.stop();
|
||||
this.tweenScaleUp = null;
|
||||
}
|
||||
if(typeof this.tweenScaleDown !== "undefined") {
|
||||
if(this.tweenScaleDown !== null) {
|
||||
this.tweenScaleDown.stop();
|
||||
this.tweenScaleDown = null;
|
||||
}
|
||||
|
||||
this.scale.set(Alien.ONSTAGE_MIN_SCALE);
|
||||
}
|
||||
|
||||
goWaitingRoom() {
|
||||
@@ -117,6 +126,7 @@ class Alien extends Phaser.Sprite {
|
||||
// }
|
||||
|
||||
this.tint = 0xffffff;
|
||||
this.scale.set(Alien.ONSTAGE_MIN_SCALE);
|
||||
|
||||
// start scale tween animation
|
||||
this.removeTween();
|
||||
|
||||
Reference in New Issue
Block a user