Hey, I am having a problem with an app that I am trying to write. I have an array of Sprites that should animate. When I tell them to run a certain action, only one of them animates. Any help would be appreciated.
This is how I create the array:
for (int iCount = 0; iCount <NUMBER_OF_RUNNERS; iCount++)
{
CCSprite* pSprite;
pSprite = [CCSprite spriteWithSpriteFrameName:@"Defender_1.png"];
m_ptDefenderPos = ccp((rand()%440 + 30), 360);
m_fSpeed[iCount] = rand() % 100 + 50;
[pSprite setPosition:m_ptDefenderPos];
[m_pTeam addObject:pSprite ];
[self addChild:pSprite];
}
and this is how i tell them all to start running:
for (int iIndex = 0; iIndex < [m_pTeam count]; iIndex++)
{
CCSprite* pPlayer;
pPlayer = (CCSprite*)[m_pTeam objectAtIndex:iIndex];
[pPlayer runAction: running];
}