mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Adds forward walking on shift
The state of the shift modifier is now distributed across the network. Walking speeds and animation states are being updated according to it. Fixes #130
This commit is contained in:
parent
062402db58
commit
b798e6acac
5 changed files with 39 additions and 9 deletions
|
|
@ -30,6 +30,7 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect
|
|||
this.inBetweenRounds = true;
|
||||
this.spectatorDoll = new SpectatorDoll(this.physicsEngine, "spectatorDoll-" + this.id, this);
|
||||
this.revealedGameController = revealedGameController;
|
||||
this.modifierActivated = false;
|
||||
}
|
||||
|
||||
Player.prototype.getNickname = function() {
|
||||
|
|
@ -66,7 +67,7 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect
|
|||
|
||||
Player.prototype.move = function (direction) {
|
||||
if(!this.spawned) return false;
|
||||
this.doll.move(direction);
|
||||
this.doll.move(direction, this.modifierActivated);
|
||||
}
|
||||
|
||||
Player.prototype.stop = function () {
|
||||
|
|
@ -90,6 +91,16 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect
|
|||
this.doll.lookAt(x, y);
|
||||
}
|
||||
|
||||
Player.prototype.activateModifier = function () {
|
||||
if(!this.spawned) return false;
|
||||
this.modifierActivated = true;
|
||||
}
|
||||
|
||||
Player.prototype.deactivateModifier = function () {
|
||||
if(!this.spawned) return false;
|
||||
this.modifierActivated = false;
|
||||
}
|
||||
|
||||
Player.prototype.grab = function(item) {
|
||||
if(!this.spawned) return false;
|
||||
this.doll.grab(item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue