Commits

Pedro Ferreira  committed 7c492b3

- fix rotation of the main ship

  • Participants
  • Parent commits 15db09e

Comments (0)

Files changed (1)

     // convert to degrees
 var angleDegrees = angleRadians * 180 / Math.PI;
 
-
-
     // we multiply by -1 because the .rotation property seems to have the angles in the other direction
-//this.rotation = -1 * angleDegrees;
-this.body.SetAngle( -1 * angleDegrees );
+this.rotate( -1 * angleDegrees );
 };
     
     
-    
+Ship.prototype.rotate = function( degrees )
+{
+this.shape.rotation = degrees;
+
+this.body.SetAngle( degrees * Math.PI / 180 );
+};
+
+
     
 Ship.prototype.handleClick = function( event )  
 {