Not to sound ungrateful here, in fact I'm going to study intensely all the code you all provided, and I am extremely grateful for all the information, but for the moment I'd like to stick to the tutorial code as much as possible so I can keep following it. I can't help but think that there must be a simpler way to do it.
In fact, I have noticed that in the line
rotation = atan2( targety , targetx ) * ( 180 / PI );
the " * ( 180 / PI ) " part converts radians to degrees, meaning that all the calculations are done in degrees.
float current = rocket_sprite.getRotation();
also returns degrees, as I understand, so the only problem is the range.
I have tried calculating the current angle manually, using this code:
float current = atan2( rocket_sprite.getPosition().y , rocket_sprite.getPosition().x ) * ( 180 / PI );
As you might have guessed, it didn't make any difference. But I still think that there must be a solution along those lines with minimal changes to the tutorial code. I'm just not good enough at math to find it.
Still, I *do* appreciate immensely all the examples and information you provided, and I *will* study them. Just after I manage to finish the tutorial. :-)
So, if you are still willing to help me convert just the range of "getRotation()", I'm still open to suggestions. :-)