mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
fixed double update problem on PlayerController
This commit is contained in:
parent
ce0d0204ea
commit
5f2be233ba
3 changed files with 3 additions and 5 deletions
|
|
@ -1,11 +1,10 @@
|
||||||
define([
|
define([
|
||||||
"Game/Client/Control/Input/XyInput",
|
"Game/Client/Control/Input/XyInput",
|
||||||
"Game/Config/Settings",
|
"Game/Config/Settings",
|
||||||
"Lib/Utilities/NotificationCenter",
|
"Lib/Utilities/NotificationCenter"
|
||||||
"Lib/Utilities/RequestAnimFrame"
|
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, Nc, requestAnimFrame) {
|
function (Parent, Settings, Nc) {
|
||||||
|
|
||||||
function GamepadInput(playerController) {
|
function GamepadInput(playerController) {
|
||||||
this.playerController = playerController;
|
this.playerController = playerController;
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ function (Parent, KeyboardInput, MouseInput, Nc, GamepadInput) {
|
||||||
PlayerController.prototype = Object.create(Parent.prototype);
|
PlayerController.prototype = Object.create(Parent.prototype);
|
||||||
|
|
||||||
PlayerController.prototype.update = function() {
|
PlayerController.prototype.update = function() {
|
||||||
|
Parent.prototype.update.call(this);
|
||||||
this.gamepadInput.update();
|
this.gamepadInput.update();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
|
||||||
|
|
||||||
this.animationRequestId = requestAnimFrame(this.update.bind(this));
|
this.animationRequestId = requestAnimFrame(this.update.bind(this));
|
||||||
|
|
||||||
if(this.me && this.me.playerController) this.me.playerController.update();
|
|
||||||
|
|
||||||
this.physicsEngine.update();
|
this.physicsEngine.update();
|
||||||
|
|
||||||
if(this.me) {
|
if(this.me) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue