mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixed input controllerism - fixes #28
This commit is contained in:
parent
a59a258ad6
commit
f5eacb6335
13 changed files with 163 additions and 223 deletions
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue