-(void)playpattern {
for (int i = 0; i < 36; i++) {
int button = myIntegers [i];
if (button==1) {
[yellow setVisible:NO];
}
}
BELOW INIT
for (int i = 0; i < 36; i++)
myIntegers [i]=(i%4)+1;
yellowbg = [CCSprite spriteWithFile:@"yellowxlixk.png"];
[yellowbg setPosition:ccp(509, 671.75)];
yellowbg.scale = .75;
[self addChild:yellowbg z: 1];
[self playpattern];
}
return self;
}
如何在启动时延迟此操作?我对此很新,请在解释中作为基础。如果我需要添加任何内容,请告诉我。
答案 0 :(得分:1)
您可以使用performSelector OR scheduleOnce。
使用scheduleOnce。
[self scheduleOnce:@selector(playpattern)延迟:3];
使用performSelector
[self performSelector:@selector(playpattern)withObject:nil afterDelay:3];