var ControlPlugin = new tine._plugin({ initialize : function() { this.gamepad = null; }, preUpdate : function() { this.gamepad = this.game.gamepad.get(0); }, enter : function() { this.game.control = this; }, exit : function() { delete this.game.control; }, left: function() { return this.game.keyboard.isDown(tine.keys.LEFT) || this.gamepad.leftStickX < -0.75; }, right: function() { return this.game.keyboard.isDown(tine.keys.RIGHT) || this.gamepad.leftStickX > 0.75; }, actionA: function() { return this.game.keyboard.isPressed(tine.keys.Q) || this.gamepad.isPressed(tine.pad.A); }, actionB: function() { return this.game.keyboard.isPressed(tine.keys.W) || this.gamepad.isPressed(tine.pad.B); }, actionC: function() { return this.game.keyboard.isPressed(tine.keys.E) || this.gamepad.isPressed(tine.pad.X); }, })