Essentially I'm just trying to rotate an object (mc) clockwise or anticlockwise depending on the value of a variable called 'angle'.
If 'angle' is positive it should go anticlockwise.
If 'angle' is negative it should go clockwise.
Is there a quicker way to do this than Option 1?
Is Option 2 any better?
Is there an even quicker alternative I'm not considering?
Option 1
PHP Code:
if(angle > 0) {
mc.rotation += rotateIncrement;
}
else if(angle < 0) {
mc.rotation -= rotateIncrement;
}
Option 2
PHP Code:
mc.rotation += rotateIncrement * Math.abs(angle)/angle;