I have a layer (ballLayer) where pretty much most of my game takes place. In this layer, I want to add two kinds of balls, one explodes after three seconds.
So I've setup the class (subclassing CocosNode), all I need to do is
> Ball *ball = [[Ball alloc] initWithStuff:etc];
and I've instantiated the ball (done in my ballLayer.m).
I figure that it'd be easier if I had my class take care of its action for me, so I gave it a message:
> [ball explode];
where explode is a method in the Ball.m :
> -(void) explode {
> [self schedule: @selector(tick:) interval: 1.0f/60.0f];
> }
Now here's where I'm getting held up. I'm getting nothing in my -(void)tick:(ccTime)dt {...} function. I can even change the tick to "tickYou" and it doesn't even throw up an error or stop the program while running.
The most likely explanation is that I'm misunderstanding what CocosNode is, or how to setup a schedule. I can do it just fine in my main game layer class, but when I try to set one up for the instance of the ball itself, I've got nothing.
Any help, comments, suggestions, vulgar remarks about my dumb mistake are appreciated (I'm still new to programming). Thanks!