From 86572965e3d61e0b4dd22ee7294400d335e28dea Mon Sep 17 00:00:00 2001 From: starnakin Date: Fri, 2 Feb 2024 16:38:01 +0100 Subject: [PATCH] game: fix: sync client and server --- frontend/static/js/api/game/Ball.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/api/game/Ball.js b/frontend/static/js/api/game/Ball.js index 6836317..dd8187d 100644 --- a/frontend/static/js/api/game/Ball.js +++ b/frontend/static/js/api/game/Ball.js @@ -46,7 +46,7 @@ class Ball */ draw(ctx) { - ctx.rect(this.position.x - this.size / 2, this.position.y - this.size / 2, this.game.config.ball_size, this.game.config.ball_size); + ctx.rect(this.position.x - this.size / 2, this.position.y - this.size / 2, this.size, this.size); } /** @@ -58,7 +58,7 @@ class Ball let distance = this.speed * (this.game.time.deltaTime() / 1000) this.position.x = this.position.x + distance * Math.cos(this.angle); - this.position.y = this.position.y + distance * Math.sin(this.angle); + this.position.y = this.position.y - distance * Math.sin(this.angle); this.draw(ctx); }