angularAcceleration
is used to increase/decrease the angularVelocity
of a FlxSprite
in degrees per second.
// object's angularVelocity will increase by 30 degrees per second
object.angularAcceleration = 30
angularAcceleration
is used to increase/decrease the angularVelocity
of a FlxSprite
in degrees per second.
// object's angularVelocity will increase by 30 degrees per second
object.angularAcceleration = 30
package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
class PlayState extends FlxState
{
var sprite:FlxSprite;
override function create()
{
super.create();
sprite = new FlxSprite("assets/arrow.png");
sprite.screenCenter();
add(sprite);
sprite.angularAcceleration = 30;
}
override function update(elapsed:Float)
{
if (Math.abs(sprite.angularVelocity) >= 600)
sprite.angularAcceleration *= -1;
super.update(elapsed);
}
}