added joints

This commit is contained in:
jeena 2013-12-28 02:39:32 +01:00
parent fa110ff4a8
commit 764220675b
10 changed files with 111 additions and 24 deletions

View file

@ -14,7 +14,8 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
this.keyboardInput = new KeyboardInput(this);
this.xyInput = new MouseInput(this);
NotificationCenter.on("onXyChange", this.setXY, this);
NotificationCenter.on("input/onXyChange", this.setXY, this);
NotificationCenter.on("input/onHandAction", this.handAction, this);
var keys = {
w:87,
@ -71,6 +72,12 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
NotificationCenter.trigger('sendGameCommand', 'lookAt', options);
};
PlayerController.prototype.handAction = function(x, y) {
var options = {x:x, y:y};
Parent.prototype.handAction.call(this, options);
NotificationCenter.trigger("sendGameCommand", "handAction", options);
};
PlayerController.prototype.update = function () {
this.keyboardInput.update();
Parent.prototype.update.call(this);