diff --git a/src/entity/entity.js b/src/entity/entity.js index 7906d24567..74c8e89f60 100644 --- a/src/entity/entity.js +++ b/src/entity/entity.js @@ -1127,15 +1127,20 @@ if (me.debug.renderHitBox && this.collisionBox) { // draw the collisionBox this.collisionBox.draw(context, "red"); - + } + if (me.debug.renderVelocity) { // draw entity current velocity - var x = ~~(this.pos.x + this.hWidth); - var y = ~~(this.pos.y + this.hHeight); - + var x = ~~(this.pos.x + this.hWidth); + var y = ~~(this.pos.y + this.hHeight); + + context.strokeStyle = "blue"; context.lineWidth = 1; context.beginPath(); - context.moveTo(x , y); - context.lineTo(x + ~~(this.vel.x * this.hWidth), y + ~~(this.vel.y * this.hHeight)); + context.moveTo(x, y); + context.lineTo( + x + ~~(this.vel.x * this.hWidth), + y + ~~(this.vel.y * this.hHeight) + ); context.stroke(); } },