I’m actually able to reproduce this with a single CCParallaxNode. Here is the code:
CCSize size = CCDirector::sharedDirector()->getWinSize();
space = CCParallaxNode::node(); space->setPosition(ccp(0, 0));
CCSprite *stars3 = CCSprite::spriteWithFile("Starfield3.png"); space->addChild(stars3, 0, ccp(-1, 2), ccp(0, 0)); CCSprite *stars2 = CCSprite::spriteWithFile("Starfield2.png"); stars2->setAnchorPoint(ccp(0,0)); space->addChild(stars2, 1, ccp(-2, 4), ccp(0, 0)); CCSprite *stars1 = CCSprite::spriteWithFile("Starfield1.png"); stars1->setAnchorPoint(ccp(0,0)); space->addChild(stars1, 2, ccp(-4, 8), ccp(0, 0));
CCSprite *grid = CCSprite::spriteWithFile("HexGrid.png"); grid->setAnchorPoint(ccp(0,0)); CCSize gridSize = grid->getContentSize(); space->addChild(grid, 3, ccp(-10, 20), ccp(0, 0));
this->addChild(space);
CCMoveBy *moveLeft = CCMoveBy::actionWithDuration(5.0, ccp(200, 0)); CCMoveBy *moveRight = CCMoveBy::actionWithDuration(5.0, ccp(-200, 0));
CCSequence *sequence = CCSequence::actionOneTwo(moveLeft, moveRight); CCRepeatForever *repeat = CCRepeatForever::actionWithAction(sequence);
space->runAction(repeat);
The files are here: http://lts.cr/Bayt