diff --git a/js/class.js b/js/class.js index 1ee23d9..0c17370 100644 --- a/js/class.js +++ b/js/class.js @@ -52,7 +52,7 @@ class Player if(this.dir!=0){ this.visibleDir = newDirection; } - console.log("Should send: {type='update', dir=",this.dir,", x=",this.x,", y=",this.y,"}"); + //console.log("Should send: {type='update', dir=",this.dir,", x=",this.x,", y=",this.y,"}"); } update(squares,circles)//update position diff --git a/js/game.js b/js/game.js index 6a6ac50..5c60a84 100644 --- a/js/game.js +++ b/js/game.js @@ -34,6 +34,22 @@ function game() { } else { + let playerToUpdate = Net.getPlayersToUpdate(); + for (let i = 0;i= 0; i--) { players[i].update([],[]);//squares, circles diff --git a/js/input.js b/js/input.js index 97cb99c..194dd25 100644 --- a/js/input.js +++ b/js/input.js @@ -79,8 +79,8 @@ class Input { } if(oldDir!=this.dir) { - this.player.changeDirection(this.dir) - this.network.update(this.player) + this.player.changeDirection(this.dir); + this.network.update(this.player); } }