diff --git a/phosphorus.js b/phosphorus.js index 8b26b4c7..6b0dad8b 100644 --- a/phosphorus.js +++ b/phosphorus.js @@ -1651,7 +1651,13 @@ var P = (function() { x = sprite.scratchX; y = sprite.scratchY; } - this.direction = Math.atan2(x - this.scratchX, y - this.scratchY) * 180 / Math.PI; + var dx = x - this.scratchX; + var dy = y - this.scratchY; + if (dx === 0 && dy === 0) { + this.direction = 90; + } else { + this.direction = Math.atan2(dx, dy) * 180 / Math.PI; + } if (this.saying) this.updateBubble(); };