Commit b6c9428a by Alexander Bazo

Fix rotation issue for enemy object

parent 3650d400
...@@ -22,7 +22,7 @@ class Enemy extends GameObject { ...@@ -22,7 +22,7 @@ class Enemy extends GameObject {
context.fillStyle = this.color; context.fillStyle = this.color;
context.beginPath(); context.beginPath();
context.translate(this.x, this.y); context.translate(this.x, this.y);
context.rotate(this.direction * Math.PI / 180); context.rotate((90 + this.direction) * Math.PI / 180);
context.moveTo(0, -this.height / 2); context.moveTo(0, -this.height / 2);
context.lineTo(-(this.width / 2), this.height / 2); context.lineTo(-(this.width / 2), this.height / 2);
context.lineTo(this.width / 2, this.height / 2); context.lineTo(this.width / 2, this.height / 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment