Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- metekUstreljen() : void {
- console.log(this.rotacijaTanka);
- console.log("enemy:" + this._SCENE.getObjectByName("enemyTankec").position.x);
- if (this.rotacijaTanka >= 0) {
- this.tween = new TWEEN.Tween(this._SCENE.getObjectByName("nasMetek").position).to({ x: this.premikKoordinate[this.rotacijaTanka][0]*30, z: this.premikKoordinate[this.rotacijaTanka][2]*30 }, 300).start();
- this.tween.easing(TWEEN.Easing.Quadratic.In);
- } else {
- this.tween = new TWEEN.Tween(this._SCENE.getObjectByName("nasMetek").position).to({ x: this.premikKoordinate[40 +this.rotacijaTanka][0]*30, z: this.premikKoordinate[40 + this.rotacijaTanka][2]*30 }, 300).start();
- this.tween.easing(TWEEN.Easing.Quadratic.In);
- }
- if(this.rotacijaTanka == 0 && this._SCENE.getObjectByName("enemyTankec").position.x > -2 && this._SCENE.getObjectByName("enemyTankec").position.x < 2){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == 1 && this._SCENE.getObjectByName("enemyTankec").position.x >= 2 && this._SCENE.getObjectByName("enemyTankec").position.x < 5){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == 2 && this._SCENE.getObjectByName("enemyTankec").position.x >= 5 && this._SCENE.getObjectByName("enemyTankec").position.x < 8){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == 3 && this._SCENE.getObjectByName("enemyTankec").position.x >= 8 && this._SCENE.getObjectByName("enemyTankec").position.x < 11){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == 4 && this._SCENE.getObjectByName("enemyTankec").position.x >= 11 && this._SCENE.getObjectByName("enemyTankec").position.x < 13){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == 5 && this._SCENE.getObjectByName("enemyTankec").position.x >= 13 && this._SCENE.getObjectByName("enemyTankec").position.x <= 15){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == -1 && this._SCENE.getObjectByName("enemyTankec").position.x <= -2 && this._SCENE.getObjectByName("enemyTankec").position.x > -5){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == -2 && this._SCENE.getObjectByName("enemyTankec").position.x <= -5 && this._SCENE.getObjectByName("enemyTankec").position.x > -8){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == -3 && this._SCENE.getObjectByName("enemyTankec").position.x <= -8 && this._SCENE.getObjectByName("enemyTankec").position.x > -11){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == -4 && this._SCENE.getObjectByName("enemyTankec").position.x <= -11 && this._SCENE.getObjectByName("enemyTankec").position.x > -13){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }else if(this.rotacijaTanka == -5 && this._SCENE.getObjectByName("enemyTankec").position.x >= -13 && this._SCENE.getObjectByName("enemyTankec").position.x <= -15){
- let alert = this.alertCtrl.create({
- title: "Nice shot!",
- subTitle: "You have hit the target. Money doubled.",
- buttons: ['OK']
- });
- alert.present();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement