瀏覽代碼

修改新版本方向

yichael 3 年之前
父節點
當前提交
3f05cccdaa
共有 1 個文件被更改,包括 16 次插入2 次删除
  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;
         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)