From e4f635f83cf2b49bb3c10d799576dce9a02814ee Mon Sep 17 00:00:00 2001 From: Baptiste Date: Fri, 29 Dec 2023 12:06:42 +0100 Subject: [PATCH] =?UTF-8?q?feat:drawcollision=20plus=20pouss=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/js/render.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public_html/js/render.js b/public_html/js/render.js index 564b7ab..674edfe 100644 --- a/public_html/js/render.js +++ b/public_html/js/render.js @@ -186,6 +186,19 @@ class Render { this.ctx.stroke(); this.ctx.closePath(); }); + //on draw le centre du joueur + this.ctx.beginPath(); + this.ctx.fillStyle="blue" + this.ctx.arc(player.x, player.y, 3, 0, 2 * Math.PI); + this.ctx.fill(); + this.ctx.closePath(); + //on draw les collisions autour du joueur + this.ctx.beginPath(); + this.ctx.strokeStyle="red" + this.ctx.arc(player.x, player.y, playerSize/2, 0, 2 * Math.PI); + this.ctx.lineWidth="2"; + this.ctx.stroke(); + this.ctx.closePath(); } cars.forEach((car) => {