kidd3166 há 1 ano atrás
pai
commit
d513dde455

+ 9 - 3
smart-shoes-artillery-fire/assets/Script/Game/Game/View/ArtilleryFireView/ArtilleryFireView.ts

@@ -38,6 +38,7 @@ export default class ArtilleryFireView extends BasicView {
 
     private killEnemyCount: _IProperty;
     private currentEnemys: Array<number>;
+    private life:number = 3;
 
     protected _initView(): void {
         this.gameConfig = JsonResources.getResources(_EJsonRes.Game);
@@ -76,7 +77,7 @@ export default class ArtilleryFireView extends BasicView {
     }
 
     protected _refreshView(): void {
-        SDK.onGameStart();
+        // SDK.onGameStart();
         ConstObject.Pass = 0;
 
         this.mapLoopIndex = 1;
@@ -131,7 +132,12 @@ export default class ArtilleryFireView extends BasicView {
                 if (Math.abs(enemy.enemy.x-this.player.player.x)+Math.abs(enemy.enemy.y-this.player.player.y) <= enemy.enemy.getChild("collide"+(enemy.level+1)).width+this.player.player.width/2) {
                     enemy.isMove = false;
 
-                    this.killRole();
+                    // this.killRole();
+                    if(--this.life < 1){
+                        this.killRole();
+                    }else{
+                        enemy.injured(99, false);
+                    }
                     break;
                 }
             }
@@ -278,7 +284,7 @@ export default class ArtilleryFireView extends BasicView {
 
         this.createEnemyLevel();
         this.killEnemyCount.max = this.currentEnemys.length*this.gameConfig.pass.attackCount;
-
+        this.life = 3;
         this.createEnemy();
 
         this.unschedule(this.launchMissileComplete);

+ 1 - 0
smart-shoes-artillery-fire/assets/Script/Game/View/GameView/GameView.ts

@@ -87,6 +87,7 @@ export default class GameView extends BasicView {
             EventManager.sendEvent(GameEventName.Audio.Audio_PlaySound, playSound);
             
             this.startCountdownAnimation();
+            SDK.onGameStart();
         });
         EventManager.onEvent(GameEventName.Fight.Fight_FightData, this, this.onFightData);
         // EventManager.onEvent(GameEventName.SDK.SDK_Confirm, this, this.onStart);

+ 2 - 0
smart-shoes-cat-upgrade/assets/Script/Game/Game/Unit/Cat.ts

@@ -88,6 +88,7 @@ export default class Cat extends Unit {
         Tool.Tween.destroy(this.fgui.id);
 
         if (posY >= this.fgui.y) {
+            ConstObject.GameState = _ECommonState.Fail;
             Tool.Tween.tweenTo(this.fgui, cc.tween(this.fgui)
                 .bezierTo(0.7, cc.v2(this.fgui.x, this.fgui.y), cc.v2(this.fgui.x+((posX >= this.fgui.x)? -200:200), this.fgui.y-200), cc.v2(this.fgui.x+((posX >= this.fgui.x)? -400:400), this.fgui.y+200))
                 .call(() => {
@@ -99,6 +100,7 @@ export default class Cat extends Unit {
             );
         }
         else {
+            ConstObject.GameState = _ECommonState.Fail;
             Tool.Tween.tweenTo(this.fgui, cc.tween(this.fgui)
                 .to(0.7, {y: this.fgui.y+200})
                 .call(() => {

+ 1 - 1
smart-shoes-cat-upgrade/assets/Script/Game/View/GameView/GameView.ts

@@ -144,7 +144,7 @@ export default class GameView extends BasicView {
     }
 
     private onPause (): void {
-        if (ConstObject.GameState == _ECommonState.Runing || this.fgui.getChild("countdown").asCom.visible == false) {
+        if (ConstObject.Time > 0 && ConstObject.GameState <= _ECommonState.Runing && this.fgui.getChild("countdown").asCom.visible == false) {
             let playSound: _IPlaySound = {
                 url: GameAudioResData.ClickButton,
                 callback: null,

+ 1 - 1
smart-shoes-cat-upgrade/settings/project.json

@@ -1,5 +1,5 @@
 {
-  "last-module-event-record-time": 1665651009589,
+  "last-module-event-record-time": 1670922734805,
   "group-list": [
     "default"
   ],