| 2760 |
this.height = height; |
this.height = height; |
| 2761 |
this.targetFps = 0; |
this.targetFps = 0; |
| 2762 |
this.loadingSceneClass = LoadingScene; |
this.loadingSceneClass = LoadingScene; |
| 2763 |
|
this.keymap = { |
| 2764 |
|
13: Keytype.Enter, |
| 2765 |
|
27: Keytype.Esc, |
| 2766 |
|
37: Keytype.Left, |
| 2767 |
|
38: Keytype.Up, |
| 2768 |
|
39: Keytype.Right, |
| 2769 |
|
40: Keytype.Down |
| 2770 |
|
}; |
| 2771 |
this.loaded = new Trigger(); |
this.loaded = new Trigger(); |
| 2772 |
this.update = new Trigger(); |
this.update = new Trigger(); |
| 2773 |
this.pointDown = new Trigger(); |
this.pointDown = new Trigger(); |
| 2957 |
var offset = this.getOffsetByEvent(touch); |
var offset = this.getOffsetByEvent(touch); |
| 2958 |
var param = new InputPointEvent(InputEventAction.Up, touch, this.dragParam.entity, offset); |
var param = new InputPointEvent(InputEventAction.Up, touch, this.dragParam.entity, offset); |
| 2959 |
this.eventQueue.push(param); |
this.eventQueue.push(param); |
|
this.dragParam = null; |
|
| 2960 |
} |
} |
| 2961 |
|
this.dragParam = null; |
| 2962 |
e.preventDefault(); |
e.preventDefault(); |
| 2963 |
}; |
}; |
| 2964 |
Game.prototype.pointHandler = function () { |
Game.prototype.pointHandler = function () { |
| 2991 |
} |
} |
| 2992 |
}; |
}; |
| 2993 |
Game.prototype.keyboardHandler = function () { |
Game.prototype.keyboardHandler = function () { |
|
this.keymap = { |
|
|
13: Keytype.Enter, |
|
|
27: Keytype.Esc, |
|
|
37: Keytype.Left, |
|
|
38: Keytype.Up, |
|
|
39: Keytype.Right, |
|
|
40: Keytype.Down |
|
|
}; |
|
| 2994 |
try { |
try { |
| 2995 |
document.addEventListener("keydown", JGUtil.proxy(this.onkeydown, this), false); |
document.addEventListener("keydown", JGUtil.proxy(this.onkeydown, this), false); |
| 2996 |
document.addEventListener("keyup", JGUtil.proxy(this.onkeyup, this), false); |
document.addEventListener("keyup", JGUtil.proxy(this.onkeyup, this), false); |
| 3121 |
}; |
}; |
| 3122 |
Game.prototype.raiseInputEvent = function () { |
Game.prototype.raiseInputEvent = function () { |
| 3123 |
var e; |
var e; |
|
if(this.eventQueue.length > 1) { |
|
|
console.log("input event: " + this.eventQueue.length); |
|
|
} |
|
| 3124 |
while(e = this.eventQueue.shift()) { |
while(e = this.eventQueue.shift()) { |
| 3125 |
var n = this.inputEventMap[e.type][e.action]; |
var n = this.inputEventMap[e.type][e.action]; |
| 3126 |
if(e.type == InputEventType.Keyboard) { |
if(e.type == InputEventType.Keyboard) { |