Saturday, 7 September 2013

Set sprite rotation based on heading

Set sprite rotation based on heading

I want to set a 2D sprite's rotation so it faces the direction it's moving
in. Currently I hooked the accelerometer to the sprite's linear velocity
and when I tilt my device it doesn't rotate, only moves. I am running
AndEngine on Android.
I want to calculate x+/x-/y+/y- to receive a value in rotation degrees.

No comments:

Post a Comment