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); }