Sprite position to placed

I am explaining my game scene:
I have created a sprite and rotated it in the update method…When user tap on the screen the
rotation stops and it is moved along the direction of angle .I am not
able to find it right, how to move child sprite along the angle
direction.
Plz tell me if you have any idea with this.
thanx in advance
:smile:

please include the code

hey what happened???

sorry just saw you have updated.
why are you doing so much calculation?

auto dacoit = (dummyPlayer->getContentSize().heightdummyPlayer->getScale()) /2+(platformList.at(0)->getContentSize().heightplatformList.at(0)->getScale()) / 2;
Vec2 v = Vec2(dacoit*cos(CC_DEGREES_TO_RADIANS(movementAngle)), dacoit * sin(CC_DEGREES_TO_RADIANS(movementAngle)));
dummyPlayer->setPosition(platformList.at(0)->getPosition() +v);

try taking just the position of the first sprite and assign it to the second like this:

dummyPlayer->setPosition(platform->getPosition());

I am explaining my game scene:
I have created a sprite and rotated it through action.Then I add a child to this sprite on its top.So this is also rotating due its parent rotation.When user tap on the screen the rotation stops and child is moved along the direction of angle .I am not able to find it right how to move child sprite along the angle direction.
Plz tell me if you have any idea with this.

i see, my solution would be to create a scene with physics with gravity 0,0
the first sprite would be separated from the second.
to the second sprite i will set angular velocity, and when the user taps i would set it to 0, then i would calculate the sin(x) and the cos(x) of the angle and apply velocity (sin(x)*FORCE,cos(x)*FORCE) to that sprite, FORCE is a float.
if i want the the first sprite rotate as well then i would apply the same angular velocity but with filtering
maybe my calculation are wrong so i would use drawNode to debug it.


hope it would help

thnx for your suggestion but I don’t want to use physics .I want to do it only without bodies and physics
If you have any idea how I can move the child sprite along the angle of parent.Parent is not moving anywhere.

try to move to (sin(x)FORCE,cos(x)FORCE) and see how it goes, it ,may work