In my game, I need to rotate coin for that I am using ActionTween
like below
auto animateTo=ActionTween::create(.4, "roll", 0.f, M_PI_2);
auto animateFrom=ActionTween::create(.4, "roll", M_PI_2, M_PI);
auto seq=Sequence::create(animateTo,animateFrom, NULL);
coin->runAction(seq);
I have implemented the ActionTweenDelegate
too like
class GameScene : Base, public ActionTweenDelegate
and implemented the method
void updateTweenAction(float value, const std::string& key);
But everytime I get
Assert failed: target must implement ActionTweenDelegate Assertion failed: (dynamic_cast(target)), function startWithTarget
I have tried to set startTarget
as well like
animateTo->setOriginalTarget(this);
animateFrom->setOriginalTarget(this);
But no luck, nothing working it crashes everytime.
Please if anyone experienced the same thing, help.
Thanks.