Skip to content

Commit

Permalink
Fix me.debug.renderVelocity
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte committed Apr 29, 2013
1 parent 747838e commit 59bd7f2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/entity/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
},
Expand Down

0 comments on commit 59bd7f2

Please sign in to comment.