diff --git a/common/player.js b/common/player.js index 1a2ee22..2ed49d1 100644 --- a/common/player.js +++ b/common/player.js @@ -38,6 +38,8 @@ Player.prototype.bump = function () { player.dir *= -1; } + console.log(player.ticks) + player.vel.x *= 0.3; player.vel.y *= 0.3; diff --git a/static/js/index.js b/static/js/index.js index f9d5aa2..3de6f66 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -82,7 +82,7 @@ class Game extends GameBasic { this.entities.push(this.player); } else { player.bump(); - this.ws.send(JSON.stringify({ vel, dir, you })); + this.sync(); } } sync() {