Skip to content

Instantly share code, notes, and snippets.

@scope2229
Created July 5, 2018 07:35
Show Gist options
  • Save scope2229/33d9f122f03584ad57fd7abc980bccd7 to your computer and use it in GitHub Desktop.
Save scope2229/33d9f122f03584ad57fd7abc980bccd7 to your computer and use it in GitHub Desktop.
launchTaiBomber(){
console.log("lanuchTaiBomber");
let launch = this.taiBombers.countActive();
this.startingX = Phaser.Math.Between(100, 700);
if(this.score >= 50){
if(launch == 0){
let delay = Phaser.Math.Between(3000, 7000);
console.log(delay + "Time delay");
console.log("lanuch is false now start emmiting enimes");
console.log("taiBomb" + this);
let taibomber = this.taiBombers.getChildren();
let tbRow1 = this.taiBombers.create(this.startingX, 120, 'taiBomber');
tbRow1.body.velocity.y = 30;
let tbRow2 = this.taiBombers.create((this.startingX - 30), 70, 'taiBomber').setVelocityY(30);
let tbRow3 = this.taiBombers.create((this.startingX + 30), 70, 'taiBomber').setVelocityY(30);
console.log(tbRow1.y + ' first row location');
this.time.delayedCall({ delay: 800, callback: this.launchTaiBomber, callbackScope: this });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment