Browse Source

修复动作,修复提示

FantasyUFG 5 years ago
parent
commit
efcb6aa0b3

File diff suppressed because it is too large
+ 212 - 435
assets/scene/Game.fire


+ 5 - 8
assets/scene/Loading.fire

@@ -17,7 +17,7 @@
         "__id__": 2
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [],
     "_prefab": null,
     "_opacity": 255,
@@ -480,7 +480,7 @@
     "_spriteFrame": {
       "__uuid__": "93dd899f-a084-4dd3-912a-37fc1fc6778f"
     },
-    "_type": 0,
+    "_type": 1,
     "_sizeMode": 1,
     "_fillType": 0,
     "_fillCenter": {
@@ -681,7 +681,7 @@
     "_spriteFrame": {
       "__uuid__": "b970bbe6-39cd-467f-9269-fc4b14c98257"
     },
-    "_type": 0,
+    "_type": 1,
     "_sizeMode": 0,
     "_fillType": 0,
     "_fillCenter": {
@@ -807,7 +807,7 @@
     "_spriteFrame": {
       "__uuid__": "77aa94a6-8bae-41eb-baa4-55f0bf530baa"
     },
-    "_type": 0,
+    "_type": 1,
     "_sizeMode": 1,
     "_fillType": 0,
     "_fillCenter": {
@@ -994,7 +994,7 @@
     "_spriteFrame": {
       "__uuid__": "18a7065e-2e39-4ddf-96ab-af37d5de2eaf"
     },
-    "_type": 0,
+    "_type": 1,
     "_sizeMode": 0,
     "_fillType": 0,
     "_fillCenter": {
@@ -1192,9 +1192,6 @@
         "__uuid__": "9262c3dd-4630-409f-80de-dda399beff7e"
       }
     ],
-    "ProgressBar": {
-      "__id__": 20
-    },
     "_id": "776utJ5XBDEbeKVBCznlE2"
   }
 ]

+ 55 - 22
assets/script/Game/Ai/AiCharactor.js

@@ -26,39 +26,59 @@ cc.Class({
 
         //发射攻击事件  // 普攻
         if (bLeft == 0) {
+
             //右拳
-            this.armatureDisplay.node.scaleX = 1;
-            this.armature.animation.play("attack", 1);
+
+            //this.armatureDisplay.node.scaleX = 1;
+
+            this.armature.animation.play("right_fit", 1);
             this.node.emit("attack1");
+
         } else if (bLeft == 1) {
             //左拳
-            this.armatureDisplay.node.scaleX = -1;
-            this.armature.animation.play("attack", 1);
+
+            //this.armatureDisplay.node.scaleX = -1;
+
+            this.armature.animation.play("left_fit", 1);
             this.node.emit("attack2");
+
         }
         //暴击右
         else if (bLeft == 2) {
+
+
             this.armatureDisplay.node.scaleX = -1;
-            this.armature.animation.play("critical_strike", 1);
+            this.armature.animation.play("double_hit", 1);
             this.node.emit("attack_critical_strike1");
+
+
         }
         //暴击左
         else if (bLeft == 3) {
+
+
             this.armatureDisplay.node.scaleX = 1;
-            this.armature.animation.play("critical_strike", 1);
+            this.armature.animation.play("double_hit", 1);
             this.node.emit("attack_critical_strike2");
+
+
         }
         //连击
         else if (bLeft == 4) {
+
+
             this.armatureDisplay.node.scaleX = -1;
-            this.armature.animation.play("double-hit", 1);
-            this.node.emit("attack_double-hit1");
+            this.armature.animation.play("critical_strike", 1);
+            this.node.emit("attack_double_hit1");
+
         }
         //连击
         else if (bLeft == 5) {
+
             this.armatureDisplay.node.scaleX = 1;
-            this.armature.animation.play("double-hit", 1);
-            this.node.emit("attack_double-hit2");
+            this.armature.animation.play("critical_strike", 1);
+            this.node.emit("attack_double_hit2");
+
         }
     },
     dodge(bLeft) { //躲闪
@@ -84,13 +104,13 @@ cc.Class({
             if (bLeft == 0) {
                 //左挨打
 
-                this.armatureDisplay.node.scaleX = -1;
-                this.armature.animation.play("be_beaten", 1);
+                //this.armatureDisplay.node.scaleX = -1;
+                this.armature.animation.play("be_beaten_left", 1);
             } else if (bLeft == 1) {
                 //右挨打
 
-                this.armatureDisplay.node.scaleX = 1;
-                this.armature.animation.play("be_beaten", 1);
+                //this.armatureDisplay.node.scaleX = 1;
+                this.armature.animation.play("be_beaten_right", 1);
             }
             this.node.emit("hurt_ord");
         }
@@ -100,13 +120,13 @@ cc.Class({
                 //左挨打
                 //被暴打
                 this.armatureDisplay.node.scaleX = -1;
-                this.armature.animation.play("be_critical_strike", 1);
+                this.armature.animation.play("be_double_hit", 1);
 
             } else if (bLeft == 1) {
                 //被暴打
                 //右挨打
                 this.armatureDisplay.node.scaleX = 1;
-                this.armature.animation.play("be_critical_strike", 1);
+                this.armature.animation.play("be_double_hit", 1);
             }
             this.node.emit("hurt_critical");
         }
@@ -117,12 +137,12 @@ cc.Class({
                 //被连击打
                 //左挨打
                 this.armatureDisplay.node.scaleX = -1;
-                this.armature.animation.play("be_double_hit", 1);
+                this.armature.animation.play("be_critical_strike", 1);
             } else if (bLeft == 1) {
                 //被连击打
                 //右挨打
                 this.armatureDisplay.node.scaleX = 1;
-                this.armature.animation.play("be_double_hit", 1);
+                this.armature.animation.play("be_critical_strike", 1);
             }
             this.node.emit("hurt_double");
         }
@@ -134,7 +154,7 @@ cc.Class({
     animationEventHandler(event) {
         if (event.type === dragonBones.EventObject.COMPLETE) {
             //主角
-            if (event.animationState.name === "attack") {
+            if (event.animationState.name === "right_fit" || event.animationState.name === "left_fit") {
                 console.log("attack 动作播放完毕!!!");
                 //TODO:
                 //this.armatureDisplay.node.scaleX = 0.39;
@@ -145,7 +165,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
 
             }
-            if (event.animationState.name === "be_beaten") {
+            if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_beaten_right") {
                 console.log("critical_strike 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
@@ -155,7 +175,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
 
             }
-            if (event.animationState.name === "critical_strike") {
+            if (event.animationState.name === "double_hit") {
                 console.log("critical_strike 动作播放完毕!!!");
                 //TODO:
                 //this.armatureDisplay.node.scaleX = 0.39;
@@ -165,7 +185,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
 
             }
-            if (event.animationState.name === "double-hit") {
+            if (event.animationState.name === "critical_strike") {
                 console.log("double-hit 动作播放完毕!!!");
                 //TODO:
                 //this.armatureDisplay.node.scaleX = 0.39;
@@ -190,6 +210,17 @@ cc.Class({
 
                 this.armature.animation.play("idle", 0);
 
+                this.aicontroScp._Defence = false;
+                this.aicontroScp._Statepassivity = false;
+            }
+            if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_critical_strike" ||
+                event.animationState.name === "be_double_hit" || event.animationState.name === "be_beaten_right") {
+                console.log("be_beaten 动作播放完毕!!!");
+                //TODO:
+                // this.armatureDisplay.node.scaleX = 0.39;
+
+                this.armature.animation.play("idle", 0);
+
                 this.aicontroScp._Defence = false;
                 this.aicontroScp._Statepassivity = false;
             }
@@ -199,6 +230,8 @@ cc.Class({
 
     },
     init() {
+
+
         //角色脚本
         this.controScp = this.PlayerController.getComponent('PlayerController');
         //Ai脚本

+ 25 - 7
assets/script/Game/Ai/AiPlayerController.js

@@ -47,7 +47,7 @@ cc.Class({
         this.playerctorScp = this.PlayerctorScp.getComponent('Charactor');
 
         this.stateScp = this.states.getComponent('AiPlayerStates');
-
+        this.UiController = cc.find("Canvas/UiController").getComponent('UiController');
 
     },
     update(dt) {
@@ -126,7 +126,10 @@ cc.Class({
                 if (randomnum_2 == 1) {
                     //暴击
                     this._CriticalStrike = true;
-                    this.ctorScp.attack(2);
+                    this.UiController.Ui_Shake(1);
+                    this.scheduleOnce(function() {
+                        this.ctorScp.attack(2);
+                    }, 1.8);
                     // this.AiControScp.ondefense_Ai(1, 1); //左右拳,击打类型
                     if (!this.PlayerControScp._RightDodge && !this.PlayerControScp._Defence) {
                         this.PlayerControScp._BeCriticalStrike = true;
@@ -137,7 +140,10 @@ cc.Class({
                 if (randomnum_2 == 2) {
                     //连击
                     this._DoubleHit = true;
-                    this.ctorScp.attack(4);
+                    this.UiController.Ui_Shake(1);
+                    this.scheduleOnce(function() {
+                        this.ctorScp.attack(4);
+                    }, 1.8);
                     //this.AiControScp.ondefense_Ai(1, 2); //左右拳,击打类型
                     if (!this.PlayerControScp._RightDodge && !this.PlayerControScp._Defence) {
                         this.PlayerControScp._BeDoubleHit = true;
@@ -146,7 +152,10 @@ cc.Class({
                 }
             } else { //普攻状态 普攻动作
                 this._RightJayShow = true;
-                this.ctorScp.attack(0);
+                this.UiController.Ui_Shake(1);
+                this.scheduleOnce(function() {
+                    this.ctorScp.attack(0);
+                }, 1.8);
                 //this.AiControScp.ondefense_Ai(1, 0); //左右拳,击打类型
                 if (!this.PlayerControScp._RightDodge && !this.PlayerControScp._Defence) {
                     this.PlayerControScp._Hurt = true;
@@ -163,20 +172,29 @@ cc.Class({
                 if (randomnum_2 == 1) {
                     //暴击
                     this._CriticalStrike = true;
-                    this.ctorScp.attack(2);
+                    this.UiController.Ui_Shake(2);
+                    this.scheduleOnce(function() {
+                        this.ctorScp.attack(2);
+                    }, 1.8);
                     //this.AiControScp.ondefense_Ai(1, 1); //左右拳,击打类型
                     this.playerctorScp.hurt(1, 1); //右暴击
                 }
                 if (randomnum_2 == 2) {
                     //连击
                     this._DoubleHit = true;
-                    this.ctorScp.attack(4);
+                    this.UiController.Ui_Shake(2);
+                    this.scheduleOnce(function() {
+                        this.ctorScp.attack(4);
+                    }, 1.8);
                     //this.AiControScp.ondefense_Ai(1, 2); //左右拳,击打类型
                     this.playerctorScp.hurt(1, 2); //右连击
                 }
             } else { //普攻状态 普攻动作
                 this._RightJayShow = true;
-                this.ctorScp.attack(1);
+                this.UiController.Ui_Shake(2);
+                this.scheduleOnce(function() {
+                    this.ctorScp.attack(1);
+                }, 1.8);
                 //this.AiControScp.ondefense_Ai(1, 0); //左右拳,击打类型
                 if (!this.PlayerControScp._LeftDodg && !this.PlayerControScp._Defence) {
                     this.PlayerControScp._Hurt = true;

+ 8 - 8
assets/script/Game/Ai/AiPlayerStates.js

@@ -41,34 +41,34 @@ cc.Class({
     start() {
         this.Charactor.on("attack1", () => {
             //console.log("检测到攻击2 右");
-            this.UiController.Ui_Shake(2);
+
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
         });
         this.Charactor.on("attack2", () => {
             //console.log("检测到攻击2 左");
-            this.UiController.Ui_Shake(1);
+
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
         });
         this.Charactor.on("attack_critical_strike1", () => {
             //console.log("检测到暴击2右");
-            this.UiController.Ui_Shake(2);
+            //this.UiController.Ui_Shake(2);
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
         });
         this.Charactor.on("attack_critical_strike2", () => {
             //console.log("检测到暴击2左");
-            this.UiController.Ui_Shake(1);
+            //  this.UiController.Ui_Shake(1);
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
         });
-        this.Charactor.on("attack_double-hit1", () => {
+        this.Charactor.on("attack_double_hit1", () => {
             //console.log("检测到连击2右");
-            this.UiController.Ui_Shake(2);
+            // this.UiController.Ui_Shake(2);
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
 
         });
-        this.Charactor.on("attack_double-hit2", () => {
+        this.Charactor.on("attack_double_hit2", () => {
             //console.log("检测到连击2左");
-            this.UiController.Ui_Shake(1);
+            // this.UiController.Ui_Shake(1);
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
             cc.audioEngine.playEffect(this.UiController.audioArr[3]);
 

+ 5 - 0
assets/script/Game/GameMode.js

@@ -10,7 +10,12 @@ cc.Class({
     },
 
     start() {
+        cc.resources.loadDir("prefab/Interface", (completeCount, totalCount) => {
 
+        });
+        cc.resources.loadDir("prefab/Result", (completeCount, totalCount) => {
+
+        });
     },
 
     // update (dt) {},

+ 36 - 15
assets/script/Game/Player/Charactor.js

@@ -24,36 +24,36 @@ cc.Class({
         if (bLeft == 0) {
             //右拳
             this.armatureDisplay.node.scaleX = 0.39;
-            this.armature.animation.play("left_fit", 1);
+            this.armature.animation.play("right_hit", 1);
             this.node.emit("attack");
         } else if (bLeft == 1) {
             //左拳
             this.armatureDisplay.node.scaleX = 0.39;
-            this.armature.animation.play("right_hit", 1);
+            this.armature.animation.play("left_fit", 1);
             this.node.emit("attack");
         }
         //暴击右
         else if (bLeft == 2) {
             this.armatureDisplay.node.scaleX = -0.39;
-            this.armature.animation.play("critical_strike", 1);
+            this.armature.animation.play("double_hit", 1);
             this.node.emit("attack_critical_strike");
         }
         //暴击左
         else if (bLeft == 3) {
             this.armatureDisplay.node.scaleX = 0.39;
-            this.armature.animation.play("critical_strike", 1);
+            this.armature.animation.play("double_hit", 1);
             this.node.emit("attack_critical_strike");
         }
         //连击右
         else if (bLeft == 4) {
             this.armatureDisplay.node.scaleX = -0.39;
-            this.armature.animation.play("double-hit", 1);
+            this.armature.animation.play("critical_strike", 1);
             this.node.emit("attack_double-hit");
         }
         //连击
         else if (bLeft == 5) {
             this.armatureDisplay.node.scaleX = 0.39;
-            this.armature.animation.play("double-hit", 1);
+            this.armature.animation.play("critical_strike", 1);
             this.node.emit("attack_double-hit");
         }
     },
@@ -76,12 +76,12 @@ cc.Class({
 
             if (bLeft == 0) {
                 //左挨打
-                this.armatureDisplay.node.scaleX = 0.39;
-                this.armature.animation.play("be_beaten", 1);
+                // this.armatureDisplay.node.scaleX = 0.39;
+                this.armature.animation.play("be_beaten_left", 1);
             } else if (bLeft == 1) {
                 //右挨打
-                this.armatureDisplay.node.scaleX = -0.39;
-                this.armature.animation.play("be_beaten", 1);
+                // this.armatureDisplay.node.scaleX = -0.39;
+                this.armature.animation.play("be_beaten_right", 1);
             }
             this.node.emit("hurt_ord");
         }
@@ -91,13 +91,13 @@ cc.Class({
                 //左挨打
                 //被暴打
                 this.armatureDisplay.node.scaleX = -0.39;
-                this.armature.animation.play("be_beaten", 1);
+                this.armature.animation.play("be_double_hit", 1);
 
             } else if (bLeft == 1) {
                 //被暴打
                 //右挨打
                 this.armatureDisplay.node.scaleX = 0.39;
-                this.armature.animation.play("be_beaten", 1);
+                this.armature.animation.play("be_double_hit", 1);
             }
             this.node.emit("hurt_critical");
         }
@@ -108,12 +108,12 @@ cc.Class({
                 //被连击打
                 //左挨打
                 this.armatureDisplay.node.scaleX = -0.39;
-                this.armature.animation.play("be_double_hit", 1);
+                this.armature.animation.play("be_critical_strike", 1);
             } else if (bLeft == 1) {
                 //被连击打
                 //右挨打
                 this.armatureDisplay.node.scaleX = 0.39;
-                this.armature.animation.play("be_double_hit", 1);
+                this.armature.animation.play("be_critical_strike", 1);
             }
             this.node.emit("hurt_double");
         }
@@ -149,6 +149,16 @@ cc.Class({
                 this.controScp._LeftJayShow = false;
                 this.aicontroScp._Statepassivity = false;
             }
+            if (event.animationState.name === "double_hit") {
+                console.log("critical_strike 动作播放完毕!!!");
+                //TODO:
+                //this.armatureDisplay.node.scaleX = 0.39;
+                this.armature.animation.play("idle", 0);
+
+                this.controScp._CriticalStrike = false;
+                this.aicontroScp._Statepassivity = false;
+
+            }
             if (event.animationState.name === "critical_strike") {
                 console.log("critical_strike 动作播放完毕!!!");
                 //TODO:
@@ -158,7 +168,7 @@ cc.Class({
                 this.controScp._CriticalStrike = false;
                 this.aicontroScp._Statepassivity = false;
             }
-            if (event.animationState.name === "double-hit") {
+            if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_beaten_right") {
                 console.log("double-hit 动作播放完毕!!!");
                 //TODO:
                 //this.armatureDisplay.node.scaleX = 0.39;
@@ -185,6 +195,17 @@ cc.Class({
 
                 this.controScp._Defence = false;
             }
+            if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_critical_strike" ||
+                event.animationState.name === "be_double_hit" || event.animationState.name === "be_beaten_right") {
+                console.log("be_beaten 动作播放完毕!!!");
+                //TODO:
+                // this.armatureDisplay.node.scaleX = 0.39;
+
+                this.armature.animation.play("idle", 0);
+
+                this.controScp._Defence = false;
+                this.aicontroScp._Statepassivity = false;
+            }
         }
     },
     animationEventHandler_Enter(event) {

+ 12 - 5
assets/script/Game/Touch.js

@@ -7,7 +7,7 @@ cc.Class({
     },
     onLoad() {
         this.GameMode = cc.find("GameMode").getComponent("GameMode");
-
+        this.touch_defance = cc.find("")
 
         this.nodeArr = [];
     },
@@ -26,6 +26,7 @@ cc.Class({
             if (this.GameMode._gamestart) {
                 this.node.on(cc.Node.EventType.TOUCH_START, this.ontouch_start, this);
                 this.node.on(cc.Node.EventType.TOUCH_END, this.ontouch_End, this);
+
             }
         }, 4);
     },
@@ -49,20 +50,26 @@ cc.Class({
 
         } else if (dirvecY <= 0) {
 
-            if (dirvecX > 15) {
+            if (dirvecX > 0) {
                 //console.log("右下滑!");
                 this.node.emit("gesture", { name: 'right_down' });
 
-            } else if (dirvecX < -15) {
+            } else if (dirvecX < 0) {
 
                 // console.log("左下滑!");
                 this.node.emit("gesture", { name: 'left_down' });
 
+            }
+        }
 
-            } else if (dirvecX <= 15 && dirvecX >= -15) {
-                // console.log("向下");
+    },
+    btn_touch(event) {
+        if (event.target.name == "Circle") {
+            if (this.GameMode._gamestart) {
                 this.node.emit("gesture", { name: 'down' });
             }
         }
     },
+
+
 });

+ 15 - 33
assets/script/Loading/Loading.js

@@ -13,51 +13,33 @@ cc.Class({
 
     onLoad() {
         cc.audioEngine.playMusic(this.AudioArr[0]);
-        this.init();
+        // this.init();
         this.progressBar = this.node.getChildByName('prograss_bg').getChildByName('Loading_Bar').getComponent(cc.Sprite);
+        this.startGame();
     },
 
     start() {
-        this.startGame();
+
     },
 
     /**开始游戏 */
     startGame() {
-
-        //let bundle = cc.assetManager.getBundle('01_graphics');
-        //this.progressBar.node.parent.active = true;
-        //开始加载远程资源
-        //for (let i = 0; i < 100; i++) {
-
-        // this.schedule(function() {
-        //对Sprite组件上的属性修改
-        //this.ProgressBar.fillRange += 0.01;
-        cc.resources.loadDir("", cc.Asset, (completeCount, totalCount) => {
-            this.progressBar.fillRange = completeCount / totalCount;
-        }, () => {
-            this.node.removeAllChildren(true);
-            this.node.active = false;
-            this.UiController.change_interface(this.UiController.interfacaArr, 0);
-        });
-
-        // }, (4 / 100) * i);
-        //}
-
-        // cc.resources.loadDir("assets", (completeCount, totalCount) => {
-        //     this.ProgressBar.fillRange = completeCount / totalCount;
-
+        // cc.resources.loadDir("", cc.Asset, (completeCount, totalCount) => {
+        //     this.progressBar.fillRange = completeCount / totalCount;
         // }, () => {
-
-        //     cc.director.loadScene('Game');
-        // });
-        // cc.loader.loadResDir('assets', cc.Asset, (completeCount, totalCount) => {
-        //     this.ProgressBar.fillRange = completeCount / totalCount;
-        // }, () => {
-
-        //     cc.director.loadScene('Game');
+        //     this.node.removeAllChildren(true);
+        //     this.node.active = false;
+        //     this.UiController.change_interface(this.UiController.interfacaArr, 0);
         // });
 
+        cc.resources.loadDir("texture", (completeCount, totalCount) => {
+            this.progressBar.fillRange = completeCount / totalCount;
+        }, () => {
+            cc.director.preloadScene("Game", function() {
+                cc.director.loadScene("Game");
+            });
 
+        });
     },
     // update (dt) {},
     init() {

+ 0 - 12
assets/texture.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "a293afd4-1174-4733-b1af-0a27512587be",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 0 - 12
assets/texture/Loading.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "ac066e98-fd48-493e-9d3c-5969be7c15f1",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 0 - 12
assets/texture/Result.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "18679602-d97e-43c6-9af0-f6b9dbef2366",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

Some files were not shown because too many files changed in this diff