I have a layer that I've added a particle effect to:
My layer is set up like this:
aboutLayer = [[CCLayer alloc] init]; //initialize new layer
I have particle within the layer that's set up like this:
// sun
CCParticleSystem *sun = [[CCParticleGalaxy alloc] initWithTotalParticles:650];
sun.texture = [[CCTextureCache sharedTextureCache] addImage: @"atomic.png"];
[aboutLayer addChild:sun];
[aboutLayer addChild:sun <strong>tag:kTagNode</strong>];
I want the particle within the LAYER to move so I tried something like this:
(void) ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event
{
CGPoint touchLocation = [touch locationInView: [touch view]];
CGPoint prevLocation = [touch previousLocationInView: [touch view]];
touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation];
prevLocation = [[CCDirector sharedDirector] convertToGL: prevLocation];
CGPoint diff = ccpSub(touchLocation,prevLocation);
CCNode *node = [self getChildByTag:kTagNode];
CGPoint currentPos = [node position];
[node setPosition: ccpAdd(currentPos, diff)];
I get this warning:
warning: 'CCLayer' may not respond to '-addChild:tag:'
And then the app crashes when I try to run it.
Any help would is appreciated.
DemetriusB