Forráskód Böngészése

修复角色动作,修复UiBUg

FantasyUFG 5 éve
szülő
commit
d7cd70b89f

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 4813 - 188
assets/scene/Game.fire


+ 4 - 10
assets/script/Game/Ai/AiPlayerStates.js

@@ -89,22 +89,21 @@ cc.Class({
         });
         });
         this.Charactor.on("hurt_ord", () => {
         this.Charactor.on("hurt_ord", () => {
             // console.log("检测到受普攻");
             // console.log("检测到受普攻");
-            this.UiController.Shake(this.Charactor, 1);
+            this.UiController.Shake(this.Charactor, 2);
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             this._hp = this.minusblood(this._hp);
             this._hp = this.minusblood(this._hp);
             this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
             this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
         });
         });
         this.Charactor.on("hurt_critical", () => {
         this.Charactor.on("hurt_critical", () => {
             //console.log("检测到受暴击");
             //console.log("检测到受暴击");
-            this.UiController.Shake(this.Charactor, 1);
+            this.UiController.Shake(this.Charactor, 2);
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             this._hp = this.minusblood_critical(this._hp);
             this._hp = this.minusblood_critical(this._hp);
             //console.log("暴击后的血量:", this._hp);
             //console.log("暴击后的血量:", this._hp);
             this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
             this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
         });
         });
         this.Charactor.on("hurt_double", () => {
         this.Charactor.on("hurt_double", () => {
-            this.UiController.Shake(this.Charactor, 1);
-            this.UiController.Shake(this.Charactor, 1);
+            this.UiController.Shake(this.Charactor, 2);
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
 
 
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
@@ -128,12 +127,7 @@ cc.Class({
                 self.PanelResult.addChild(cc.instantiate(ResultArr));
                 self.PanelResult.addChild(cc.instantiate(ResultArr));
             });
             });
         }
         }
-        if (this._hp <= this._damage) {
-            this.UiController.Ui_Shake(4); //气血不足
-        }
-        if (this._endurance <= this._block_minus_endurance) {
-            this.UiController.Ui_Shake(5); //能量不足不足
-        }
+
     },
     },
     init() {
     init() {
         this.gamestate = cc.find("Canvas/Game/Interface_Game").getComponent('Interface_game');
         this.gamestate = cc.find("Canvas/Game/Interface_Game").getComponent('Interface_game');

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

@@ -6,38 +6,43 @@ cc.Class({
             type: cc.AudioClip,
             type: cc.AudioClip,
             default: [],
             default: [],
         },
         },
-        ProgressBar: cc.Sprite,
+
     },
     },
 
 
     // LIFE-CYCLE CALLBACKS:
     // LIFE-CYCLE CALLBACKS:
 
 
     onLoad() {
     onLoad() {
         cc.audioEngine.playMusic(this.AudioArr[0]);
         cc.audioEngine.playMusic(this.AudioArr[0]);
-        this.startGame();
+        this.init();
+        this.progressBar = this.node.getChildByName('prograss_bg').getChildByName('Loading_Bar').getComponent(cc.Sprite);
     },
     },
 
 
     start() {
     start() {
-
+        this.startGame();
     },
     },
+
     /**开始游戏 */
     /**开始游戏 */
     startGame() {
     startGame() {
 
 
         //let bundle = cc.assetManager.getBundle('01_graphics');
         //let bundle = cc.assetManager.getBundle('01_graphics');
-        this.ProgressBar.node.parent.active = true;
+        //this.progressBar.node.parent.active = true;
         //开始加载远程资源
         //开始加载远程资源
-        for (let i = 0; i < 100; i++) {
+        //for (let i = 0; i < 100; i++) {
 
 
-            this.schedule(function() {
-                //对Sprite组件上的属性修改
-                this.ProgressBar.fillRange += 0.01;
-                cc.resources.loadDir("assets", (completeCount, totalCount) => {
+        // 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);
+        });
 
 
-                }, () => {
-                    cc.director.loadScene('Game');
-                });
+        // }, (4 / 100) * i);
+        //}
 
 
-            }, (4 / 100) * i);
-        }
         // cc.resources.loadDir("assets", (completeCount, totalCount) => {
         // cc.resources.loadDir("assets", (completeCount, totalCount) => {
         //     this.ProgressBar.fillRange = completeCount / totalCount;
         //     this.ProgressBar.fillRange = completeCount / totalCount;
 
 
@@ -53,6 +58,12 @@ cc.Class({
         // });
         // });
 
 
 
 
-    }
+    },
     // update (dt) {},
     // update (dt) {},
+    init() {
+        this.game = cc.find("Canvas/Game");
+        this.UiController = cc.find("Canvas/UiController").getComponent('UiController');
+
+
+    },
 });
 });

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott