|
@@ -3156,7 +3156,8 @@ var __extends = this.__extends || function(c, d) {
|
|
|
this.creatGameSystemPanel();
|
|
|
this.creatMusic();
|
|
|
this.creatSmokeMc();
|
|
|
- this.makePowerMc()
|
|
|
+ this.makePowerMc();
|
|
|
+ this.createKeyEvent();
|
|
|
};
|
|
|
d.prototype.creatSmokeMc = function() {
|
|
|
var b = this.queueItemArr.length -
|
|
@@ -3314,6 +3315,25 @@ var __extends = this.__extends || function(c, d) {
|
|
|
b == this.queueFrameInitArr[this.clickBtnNum] ||
|
|
|
b == this.queueFrameInitArr[this.clickBtnNum + 2] ? (console.log(" YES CLICK ! "), this.doClickYes()) : (console.log(" NO CLICK ! "), this.clickTime = 0, this.wSound.play(), this.shakeTime = this.maxShakeTime, b = this.queueItemArr.length - 1, this.queueItemArr[b].gotoAndStop("w" + this.showDataArr[b]))
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
+ //添加左右键盘按键操作
|
|
|
+ d.prototype.createKeyEvent = function(){
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ this.checkValue();
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
d.prototype.doClickYes = function() {
|
|
|
0.3 > Math.random() ? this.ySound1.play() : 0.6 > Math.random() ? this.ySound2.play() : this.ySound3.play();
|
|
|
!0 == this.inPower ? this.clickYesCount += 2 : this.clickYesCount++;
|