Throwing with Swiper, working but needs to be refined. No angulat verlocity yet.

This commit is contained in:
Jeena 2014-12-07 00:57:05 +01:00
parent 6d9d02615a
commit cf2182676b
5 changed files with 198 additions and 85 deletions

View file

@ -4,11 +4,8 @@ define([
function (Key) {
function KeyboardInput (playerController) {
this._registry = {};
this._playerController = playerController;
function KeyboardInput () {
this._registry = {};
this.init();
}
@ -34,7 +31,7 @@ function (Key) {
if (key && !key.getActive()) {
var callback = key.getKeyDownFunction();
if(callback) this._playerController[callback]();
if(callback) callback();
key.setActive(true);
}
@ -46,7 +43,7 @@ function (Key) {
var key = this._getKeyByKeyCode(e.keyCode);
if (key && key.getActive()) {
var callback = key.getKeyUpFunction();
if(callback) this._playerController[callback]();
if(callback) callback();
key.setActive(false);
}