Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CCSprite runAction and Remove
- [self schedule:@selector(throwRain) interval:0.1f];
- -(void) throwRain {
- CCSprite *gota;
- for (int i = 1; i <= 6; i++){
- gota = [CCSprite spriteWithFile:@"4_gota.png"];
- gota.position = ccp(arc4random() % 768, 1060);
- gota.scale = (arc4random () % 25 + 50.0f) / 100.0f;
- gota.rotation = 35 ;
- [self addChild:gota z:arc4random() % 5 + 7];
- [gota runAction:[CCSequence actions:[CCEaseRateAction actionWithAction:[CCMoveTo actionWithDuration:3.0f + (arc4random() % 200) / 100.0f position:ccp(gota.position.x, 0)] rate:3] , [CCCallFunc actionWithTarget:self selector:@selector(spriteDone:)], nil]];
- }
- }
- -(void) spriteDone:(id)sender {
- [self removeChild:sender cleanup:YES];
- }
Add Comment
Please, Sign In to add comment