I try to add a CCParticleSystemQuad
as child to LHSprite
:
player = [loader spriteWithUniqueName:@"player"];
NSAssert(player != nil, @"Couldn't find the player!");
// Particles
smokeParticles = [CCParticleSystemQuad particleWithFile:@"smoke.plist"];
smokeParticles.position = ccp(-30.0, 0.0);
[player addChild:smokeParticles];
But I keep getting this error message:
2012-12-29 22:51:44.373 MyProject[15396:15203]
*** Assertion failure in -[LHSprite addChild:z:tag:],
/MyPath/MyProject/libs/cocos2d/CCSprite.m:567
Adding the CCParticleSystemQuad
to the CCLayer
[self addChild:smokeParticles];
works just fine.
CCSprite.m
: Line 567
NSAssert([child isKindOfClass:[CCSprite class]],
@"CCSprite only supports CCSprites as children when using CCSpriteBatchNode");
Can anyone tell me why this happens?