How to find value of timer in cocos2d iphone
I am doing a simple stop clock like game. The game consists of a timer for 60 secs I attain it by
AtlasSpriteManager *mgr = [AtlasSpriteManager spriteManagerWithFile:@"bringit_timer.png" capacity:10];
[self addChild:mgr z:5 tag:2];
AtlasSprite *sprite = [AtlasSprite spriteWithRect:CGRectMake(0,0,33,200) spriteManager:mgr];
[mgr addChild:sprite];
sprite.position = ccp(160,240);
sprite.scale开发者_开发问答 = 1.0;
[sprite runAction:[RotateBy actionWithDuration:60 angle:360]];
After that i need to add effects by scaling up the clock for every 10sec. I can get the effect by
[Circle runAction:[ScaleTo actionWithDuration:2 scale:1.3]];
but dont know how to find 10th second. Can anyone tell me how to find the value of the timer in the 10th second with some sample code.
Why don't you have a timer fire every 10 seconds as opposed to every 60 seconds? You can have a flag/counter/etc. to count when 60 seconds have passed and then reset to watch for the next 60 seconds.
精彩评论