Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/src/js/jgame.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 76 by tsugehara, Sun Mar 31 05:38:55 2013 UTC revision 77 by tsugehara, Mon Apr 1 07:34:21 2013 UTC
# Line 2760  var Game = (function () { Line 2760  var Game = (function () {
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();
# Line 2949  var Game = (function () { Line 2957  var Game = (function () {
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 () {
# Line 2983  var Game = (function () { Line 2991  var Game = (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);
# Line 3121  var Game = (function () { Line 3121  var Game = (function () {
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) {

Legend:
Removed from v.76  
changed lines
  Added in v.77

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26