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
|
|
@ -4,11 +4,7 @@ define([
|
|||
function () {
|
||||
|
||||
function PlayerController (player) {
|
||||
|
||||
this.player = player;
|
||||
|
||||
this._shift;
|
||||
this._isJumping;
|
||||
this._walkingDirectionStatus = 0;
|
||||
}
|
||||
|
||||
|
|
@ -31,7 +27,6 @@ function () {
|
|||
|
||||
PlayerController.prototype.jump = function () {
|
||||
if(!this.isPlayerInputAllowed()) return;
|
||||
this._isJumping = true;
|
||||
this.player.jump();
|
||||
}
|
||||
|
||||
|
|
@ -44,6 +39,16 @@ function () {
|
|||
if(options) this.player.lookAt(options.x, options.y);
|
||||
}
|
||||
|
||||
PlayerController.prototype.activateModifier = function() {
|
||||
if (!this.isPlayerInputAllowed()) return;
|
||||
this.player.activateModifier();
|
||||
};
|
||||
|
||||
PlayerController.prototype.deactivateModifier = function() {
|
||||
if (!this.isPlayerInputAllowed()) return;
|
||||
this.player.deactivateModifier();
|
||||
};
|
||||
|
||||
PlayerController.prototype.update = function () {
|
||||
if(this._walkingDirectionStatus != 0) {
|
||||
this.player.move(this._walkingDirectionStatus);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue