This commit is contained in:
Jeena 2014-02-10 16:11:01 +01:00
parent 7a59e175e0
commit 89c5e4a5d8
6 changed files with 64 additions and 25 deletions

View file

@ -73,6 +73,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
}
}
}
} while (body = body.GetNext());
}
@ -91,6 +92,14 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
var player = this.players[playerId];
player.spawn(x, y);
this.gameObjects.animated.push(player.getDoll());
if(options.holdingItemUid) {
this.onHandActionResponse({
itemUid: options.holdingItemUid,
action: "grab",
playerId: playerId
});
}
}
GameController.prototype.onHandActionResponse = function(options) {
@ -112,7 +121,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
player.grab(item);
}
} else {
console.warn("Item for joint can not be found locally.")
console.warn("Item for joint can not be found locally. " + options.itemUid)
}
};