Improved the rotation of a sprite