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

@ -12,6 +12,7 @@ function (Doll, Settings) {
this.doll;
this.id = id;
this.isSpawned = false;
this.holdingItem = null;
}
Player.prototype.getDoll = function() {
@ -45,6 +46,21 @@ function (Doll, Settings) {
if(this.doll) this.doll.lookAt(x, y);
}
Player.prototype.handAction = function(x, y) {
if (this.holdingItem) {
// throw
this.doll.throw(this.holdingItem, x, y);
this.holdingItem = null;
} else {
// take
var item = this.doll.grab(x, y);
if(item) {
this.holdingItem = item;
}
}
};
Player.prototype.update = function () {
if(this.doll) {