Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rotating a sprite in HaxeFlixel

I'm having trouble with something very simple in HaxeFlixel, but I can't find one reference to it anywhere online.

All I need to do is rotate a FlxSprite. There are multiple references online to a .rotation value that can be set, but my sprite does not have access to this for some reason.

Can anyone help out here, I have no idea where to go from here.

The graphics I'm creating is of type Player, which extends FlxSprite and is created with loadGraphic().

like image 248
djcmm476 Avatar asked Dec 04 '25 19:12

djcmm476


1 Answers

FlxObject (which FlxSprite extends) has an angle property. Use it to rotate your sprites.

like image 84
user3928139 Avatar answered Dec 08 '25 14:12

user3928139