Skip to content

Commit f28df06

Browse files
authored
drawDebug, display checkCollision sides
drawDebug, instead of rectangle only draw the sides where checkCollision is true, similar to debugger in layer
1 parent 7bcd495 commit f28df06

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/physics/arcade/Body.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,12 @@ var Body = new Class({
14241424
}
14251425
else
14261426
{
1427-
graphic.strokeRect(pos.x, pos.y, this.width, this.height);
1427+
//graphic.strokeRect(pos.x, pos.y, this.width, this.height);
1428+
// only draw the sides where checkCollision is true, similar to debugger in layer
1429+
if (this.checkCollision.up) { graphic.lineBetween(pos.x, pos.y, pos.x + this.width, pos.y); }
1430+
if (this.checkCollision.right) { graphic.lineBetween(pos.x + this.width, pos.y, pos.x + this.width, pos.y + this.height); }
1431+
if (this.checkCollision.down) { graphic.lineBetween(pos.x, pos.y + this.height, pos.x + this.width, pos.y + this.height); }
1432+
if (this.checkCollision.left) { graphic.lineBetween(pos.x, pos.y, pos.x, pos.y + this.height); }
14281433
}
14291434
}
14301435

0 commit comments

Comments
 (0)