0

I have 2 events running through time in my game. I want that when gameover starts, this events stops running

This is my code:

- (void)onEnter
{
   [super onEnter];
   [self schedule:@selector(addStars:) interval:1.5];
   [self schedule:@selector(addBoxes:) interval:2.5];

}

-(void)gameOver
{

 //stop schedule addStars
 //stop schedule addBoxes

 }
Dyego
  • 67
  • 1
  • 10

1 Answers1

-1

Man, Just do this bellow:

-(void)gameOver
{
   [self unschedule:@selector(addStars:)];
   [self unschedule:@selector(addBoxes:)];
}
Dyego
  • 67
  • 1
  • 10