refactored grabbing

This commit is contained in:
Jeena 2014-01-20 18:15:40 +01:00
parent 1c4336c7f7
commit 38b5023410
7 changed files with 124 additions and 62 deletions

View file

@ -105,7 +105,16 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
}
};
player.handAction(options.x, options.y, options.isHolding, item);
if(item) {
if(options.action == "throw") {
player.throw(options.x, options.y, item);
} else if(options.action == "grab") {
player.grab(item);
}
} else {
console.warn("Item for joint can not be found locally.")
}
};
GameController.prototype.loadLevel = function (path) {