Browse Source

修改新版本方向

yichael 3 years ago
parent
commit
3f05cccdaa
1 changed files with 16 additions and 2 deletions
  1. 16 2
      assets/Scripts/Game/PlayerController.js

+ 16 - 2
assets/Scripts/Game/PlayerController.js

@@ -70,10 +70,24 @@ cc.Class({
 
 
         if(this.gStatesScp.curretState == this.gStatesScp.finished) return;
         if(this.gStatesScp.curretState == this.gStatesScp.finished) return;
         console.log('data.ename='+data.ename);
         console.log('data.ename='+data.ename);
-        if(data.ename == 'hit')
+        if(data.direction == 'straightPunch')
         {
         {
-            this.noDirectionPunch();
+            this.top();
         }
         }
+
+        if(data.direction == 'leftPunch')
+        {
+            this.left();
+        }
+
+        if(data.direction == 'rightPunch')
+        {
+            this.right();
+        }
+        // else if(data.ename == 'hit')
+        // {
+        //     this.noDirectionPunch();
+        // }
     },
     },
     //页面退出回调
     //页面退出回调
     onQuit(data)
     onQuit(data)