fixes #12 and added health

This commit is contained in:
Jeena 2014-02-10 14:21:26 +01:00
parent 6c78c750f0
commit d84fb20f90
7 changed files with 83 additions and 18 deletions

View file

@ -117,6 +117,16 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
};
GameController.prototype.onUpdateStats = function(options) {
var player = this.players[options.playerId];
player.stats = options.stats;
// FIXME: move to canvas later
if(player == this.me) {
DomController.setHealth(player.stats.health);
}
};
GameController.prototype.loadLevel = function (path) {
Parent.prototype.loadLevel.call(this, path);
}