Ver código fonte

add by xulin 201901416

添加左右键盘按键操作
yunhaipiaodi 6 anos atrás
pai
commit
a8ac6a14b1
1 arquivos alterados com 11 adições e 0 exclusões
  1. 11 0
      games/yqrxd/launcher/game-min.js

+ 11 - 0
games/yqrxd/launcher/game-min.js

@@ -3628,6 +3628,17 @@ var __extends = this.__extends || function(c, d) {
             null != this.ingame && (this.removeChild(this.ingame), this.ingame = null);
             null == this.info && (this.info = new Info, this.addChild(this.info))
         };
+      	//添加左右键盘按键操作
+        document.onkeydown = function (event) {
+            var e = event || window.event || arguments.callee.caller.arguments[0];
+            if(e && e.keycode == 39){       //右方向键
+                this.clickBtnNum = 1;
+            }
+
+            if(e && e.keycode == 37){       //左方向键
+                this.clickBtnNum = 0;
+            }
+        };
         return d
     }(egret.DisplayObjectContainer);
 MainGame.prototype.__class__ = "MainGame";