So, I have a class that is called Gameboard. In it I have an array of CCSprite pointers.
class Gameboard : public CCNode
{
private:
CCSprite* m_vSprites[6];
};
Inside the Gameboard’s init function (called in the constructor), I set the first of the Sprites (to test out).
CCSprite * newSprite = new CCSprite();
m_vSprites[0] = newSprite;
m_vSprites[0]->spriteWithFile("Triangle01.png", CCRectMake(0, 0, 480, 320));
m_vSprites[0]->setPosition(ccp(50, 50));
this->addChild(m_vSprites[0]);
Then in my GameScene (where the game starts up and occurs), I have the Gameboard pointer as a member function.
Gameboard* m_Gameboard;
And inside the GameScene’s init (like in the tutorial), I make the Gameboard and add the child of the Gameboard into it.
if(!CCLayerColor::initWithColor(ccc4(0, 0, 255, 255)))
return false;
bool bRet = false;
do
{
m_Gameboard = new Gameboard();
this->addChild(m_Gameboard);
bRet = true;
} while(0);
return bRet;
But it doesn’t show up. Can anyone help me out? I’m really at a loss of why this isn’t showing up.