From 1f89a1142d31210d9477b700dcc4160dc98c5c4d Mon Sep 17 00:00:00 2001 From: Maggie Liu <63619830+maggie-j-liu@users.noreply.github.com> Date: Mon, 7 Feb 2022 19:56:19 -0800 Subject: [PATCH 1/2] fix collision issue https://hackclub.slack.com/archives/C02UN35M7LG/p1644264656980339 --- Engine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine.js b/Engine.js index aa62a35385..5f94565ca0 100644 --- a/Engine.js +++ b/Engine.js @@ -185,7 +185,7 @@ class Object { } } - if (x >= 0 && y >= 0 && this._collides !== null) + if (ogx >= 0 && ogy >= 0 && this._collides !== null) this._collides(this, otherObj); }); From e5d757b2e526a7f5a4face432723fdd24975ae92 Mon Sep 17 00:00:00 2001 From: maggie-j-liu Date: Tue, 8 Feb 2022 16:27:25 -0800 Subject: [PATCH 2/2] fix hitbox --- Engine.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine.js b/Engine.js index 5f94565ca0..6daf5d9f08 100644 --- a/Engine.js +++ b/Engine.js @@ -226,13 +226,14 @@ class Object { ctx.fillRect(-2, -2, 4, 4); } - if (this._update !== null) this._update(obj); ctx.restore(); if (Engine.show.hitbox) { ctx.strokeStyle = "grey"; ctx.strokeRect(this.x - ox, this.y - oy, w, h); } + + if (this._update !== null) this._update(obj); } set x(val) {