CCActionInterval colorAction = CCRepeatForever::createCCSequence::create(
Why not make CCSequence::create return a CCActionInterval instead of CCFiniteTimeAction* if you are going to do that?
You are casting in the wrong direction. It may work but it sure violate the inheritance tree.
The two fields
protected:
float m_elapsed;
bool m_bFirstTick;
in CCActionInterval do not exist in CCFiniteTimeAction.
This is asking for trouble.
Andre
Is there a reason why you could not implement a CCActionInterval:create(CCArray arrayOfActions) instead which returns a CCActionInterval.
I am just looking around so I do not understand the flow yet but this look very suspicious.
You can refer to the implementation of CCSequence, it will return a pointer type of the parameter.
And the pointer type of parameter is CCFiniteTimeAction*.
you should not cast from CCFiniteTimeAction to CCActionInterval.
References to field like m_bFirstTick and m_elapsed using this pointer are illegal and could damage memory.
They cannot be detected by the compiler because of the arbitrary cast.