I have a question that is killing me...
I'm using LevelHelper to make a level in Box2d. So I have a triangular sprite attached to a triangular body.
Now the problem is that I want to rotate that body to a position, and rotate the attached sprite too.
Here you have some code:
//Detecting my actor and my sprite
if (b->GetType() == b2_dynamicBody && myActor == [loader spriteWithUniqueName:@"radar."]){
radar = b;
radarSprite = myActor;
}
Just wanted to try with 20 degrees, but it's not rotating.
//trying to rotate inside TICK: Method
float32 b2Angle = -1 * CC_DEGREES_TO_RADIANS(20);
radar->SetTransform(radar->GetPosition(), b2Angle);
radarSprite.position = ccp(radar->GetPosition().x,radar->GetPosition().y);
Any tips?
Thank you very much in advance!!