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
|
|
@ -216,6 +216,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
|||
|
||||
KeyboardAndMouse.prototype.activateModifier = function() {
|
||||
this.modifier = true;
|
||||
this.playerController.activateModifier();
|
||||
};
|
||||
|
||||
KeyboardAndMouse.prototype.deactivateModifier = function() {
|
||||
|
|
@ -223,6 +224,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
|||
this.x = this.lastLookDirection * Settings.VIEWPORT_LOOK_AHEAD;
|
||||
this.y = 0;
|
||||
this.onXyChange(this.x, this.y);
|
||||
this.playerController.deactivateModifier();
|
||||
};
|
||||
return KeyboardAndMouse;
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,18 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
|
|||
Nc.trigger(Nc.ns.client.game.zoomReset, false);
|
||||
};
|
||||
|
||||
PlayerController.prototype.activateModifier = function() {
|
||||
if (!this.isPlayerInputAllowed()) return;
|
||||
Parent.prototype.activateModifier.call(this);
|
||||
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "activateModifier");
|
||||
};
|
||||
|
||||
PlayerController.prototype.deactivateModifier = function() {
|
||||
if (!this.isPlayerInputAllowed()) return;
|
||||
Parent.prototype.deactivateModifier.call(this);
|
||||
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
|
||||
};
|
||||
|
||||
/*
|
||||
* Client overwrite - allow player input if PointerLock is locked to canvas
|
||||
* and is not in between games
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue