Created
April 21, 2011 03:40
-
-
Save alanf/933667 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CCParticleSystemAnimation.m | |
// TapZoo | |
// | |
// Created by alan fineberg on 4/20/11. | |
// Copyright 2011 Streetview Labs. All rights reserved. | |
// | |
#import "CCParticleSystemAnimation.h" | |
@implementation CCParticleSystemAnimation | |
-(void) dealloc | |
{ | |
[animation_ release]; | |
[super dealloc]; | |
} | |
-(void) setAnimation:(CCAnimation *)animation { | |
animation_ = animation; | |
[animation_ retain]; | |
} | |
-(void) update: (ccTime) dt | |
{ | |
if ( active && emissionRate ) { | |
NSArray *frames = [animation_ frames]; | |
NSUInteger numberOfFrames = [frames count]; | |
NSUInteger idx = dt * numberOfFrames; | |
if( idx >= numberOfFrames ) | |
idx = numberOfFrames -1; | |
[self setDisplayFrame: [frames objectAtIndex:idx]]; | |
} | |
[super update:dt]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment