Quellcode durchsuchen

修改帧数60,去掉战斗中抖动,怪物AI 1.0

chelios vor 3 Jahren
Ursprung
Commit
767265a854

+ 4 - 4
assets/Script/game/fight/FF.ts

@@ -567,10 +567,10 @@ export default class FF extends ViewObject {
      * 地图震动
      */
     public shockMap() {
-        cc.tween(this.mMapLayer).sequence(
-            cc.moveBy(0.05, 0, 15).easing(cc.easeBackOut()),
-            cc.moveBy(0.05, 0, -15).easing(cc.easeBackOut())
-        ).start();
+        // cc.tween(this.mMapLayer).sequence(
+        //     cc.moveBy(0.05, 0, 15).easing(cc.easeBackOut()),
+        //     cc.moveBy(0.05, 0, -15).easing(cc.easeBackOut())
+        // ).start();
     }
     //移除伙伴
     public removePet(id) {

+ 12 - 2
assets/Script/game/fight/object/AI/AIDef.ts

@@ -39,12 +39,11 @@ export default class AIDef extends cc.Component {
         this.sprite.mRigidBody.linearDamping = 60;
     }
 
-    
-
     update (dt) {
         if (this.sprite.gamePause) {
             return;
         }
+        this.AI()
         if (this.sprite.isWalk) {
             let moveV2 = this.sprite.moveV2;
             this.sprite.mRigidBody.applyLinearImpulse(
@@ -53,6 +52,17 @@ export default class AIDef extends cc.Component {
                 true
             );
         }
+    }
+
+    public AI(){
+        if(this.target && this.target.node.isValid && this.target.isActive){
+
 
+        }else{
+            
+
+        }
     }
+
+
 }

+ 1 - 1
assets/Script/main/Main.ts

@@ -79,7 +79,7 @@ export default class Main extends cc.Component {
 
     onLoad() {
         // cc.view.enableAntiAlias(false);
-        cc.game.setFrameRate(35);
+        // cc.game.setFrameRate(35);
         // cc.director.getPhysicsManager().enabledAccumulator=true;
         // cc.PhysicsManager.FIXED_TIME_STEP = 1/35
         // cc.director.getCollisionManager().enabled = true;