Skip to content

Commit

Permalink
fix hitbox
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie-j-liu committed Feb 9, 2022
1 parent 1f89a11 commit e5d757b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e5d757b

Please sign in to comment.