From 7faf448d793f0ccde7fba0bbd370de1f9137d3fb Mon Sep 17 00:00:00 2001 From: Baptiste Date: Mon, 25 Dec 2023 15:55:29 +0100 Subject: [PATCH] debug collision circle --- public_html/js/render.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public_html/js/render.js b/public_html/js/render.js index 2803b07..afd58eb 100644 --- a/public_html/js/render.js +++ b/public_html/js/render.js @@ -1,4 +1,4 @@ -let drawPortals = true; +let drawPortals = false; let drawCollisions = false; const imgPlayer = new Image(); @@ -147,6 +147,14 @@ class Render { this.ctx.fillStyle = "rgba(255, 0, 0, 0.5)"; this.ctx.fillRect(s.x,s.y,s.w,s.h); }); + maps[player.z].circles.forEach((s) => { + this.ctx.beginPath(); + this.ctx.arc(s.x, s.y, s.r, 0, 3 * Math.PI); + this.ctx.fillStyle = "rgba(255, 0, 0, 0.5)"; + this.ctx.fill(); + this.ctx.stroke(); + this.ctx.closePath(); + }); } cars.forEach((car) => {