Firs of all, you don't need to do this :
if( !CCLayerColor::initWithColor(ccc4(255, 255, 255, 255)) ) //RGBA
{
return false;
}
if ( !CCLayer::init() )
{
return false;
}
CCLayerColor
inherits from CCLayer (reference : docs) and I certainly hope you don;t inherit from both of them! :)
As to the problem at hand, I can't pinpoit a problem, but I can spot some possible pitfalls, which may be contrbuting to your issues.
A lot of nodes. You have your Layer, on which you add the
_moving
node on which you add the_pipes
node on which you add thepipePair
node. Unless they are essential for other things in your game, I can;t see a reason why you are not adding thepipePair
directly on your layer.You didn't set the position of
_moving
and_pipes
- though it may seem unimportant, it is good to explicilty position all your nodes to not be suprised later on. A usefull thing here is the`CCPointZero
.I have never had any success whatsoever with reusing
CCSequences
like you do. It always turned out to be best to just create them when they are to be used and not worry about them later on.
Hope some of these will help!