From b6c9428a9aedbc591fc1abc7bfa0dfafa4685dd1 Mon Sep 17 00:00:00 2001 From: Alexander Bazo Date: Thu, 29 Aug 2019 12:55:26 +0200 Subject: [PATCH] Fix rotation issue for enemy object --- resources/js/game/objects/Enemy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/game/objects/Enemy.js b/resources/js/game/objects/Enemy.js index b3dbf2e..fbef9c0 100644 --- a/resources/js/game/objects/Enemy.js +++ b/resources/js/game/objects/Enemy.js @@ -22,7 +22,7 @@ class Enemy extends GameObject { context.fillStyle = this.color; context.beginPath(); 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.lineTo(-(this.width / 2), this.height / 2); context.lineTo(this.width / 2, this.height / 2); -- libgit2 0.26.0