mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Throwing with Swiper, working but needs to be refined. No angulat verlocity yet.
This commit is contained in:
parent
6d9d02615a
commit
cf2182676b
5 changed files with 198 additions and 85 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue