Using baked rotations is a great way to improve graphical performance when dealing with rotating sprites. Load your the graphic for your FlxSprite
by using FlxSprite.loadRotatedGraphic()
, and the system will generate a sprite sheet for your sprite that has frames for all of the possible angles. When you set the angle of a FlxSprite
which is using baked rotations, it will choose the frame(s) that are closest to your specified angle.
// sprite's graphic will be baked using 16 rotations.
sprite.loadRotatedGraphic('path/to/image.png', 16);