fixed input controllerism - fixes #28

This commit is contained in:
Logsol 2013-07-30 18:13:39 +02:00
parent a59a258ad6
commit f5eacb6335
13 changed files with 163 additions and 223 deletions

View file

@ -15,7 +15,7 @@ function (Doll, Settings) {
this.lookDirection = 1;
this.moveDirection = 0;
this.isSpawned = false;
this.playerController = null;
}
Player.prototype.spawn = function (x, y) {
@ -177,11 +177,19 @@ function (Doll, Settings) {
if (!this.doll.getBody().IsAwake() && !this.isStanding()) {
this.setStanding(true);
}
if(this.playerController) {
this.playerController.update();
}
}
Player.prototype.destroy = function () {
this.doll.destroy();
}
Player.prototype.setPlayerController = function(playerController) {
this.playerController = playerController;
}
return Player;
});