I read about coco2d really quickly (I'll need to do some opengl in in a couple of weeks so I'm reading up)
if your using coco2d as your main framework you might want to check out there version of the timer
BestPractices - cocos2d-iphone - cocos2d for iPhone best practices - Google Code
Code:
* Try not to use Cocoa's NSTimers. Instead use cocos2d's own scheduler.
* If you use cocos2d scheduler, you will have:
o automatic pause/resume.
o when the Layer (Scene, Sprite, CocosNode) enters the stage the timer will be automatically activated, and when it leaves the stage it will be automatically deactivated.
o Your target/selector will be called with a delta time
/**********************************************************/
// OK OK OK OK OK
/**********************************************************/
-(id) init
{
if( ! [super init] )
return nil;
// schedule timer
[self schedule: @selector(tick:)];
[self schedule: @selector(tick2:) interval:0.5];
return self;
}
-(void) tick: (ccTime) dt
{
// bla bla bla
}
-(void) tick2: (ccTime) dt
{
// bla bla bla
}
/**********************************************************/
// BAD BAD BAD BAD
/**********************************************************/
// Why BAD ?
// You can't pause the game automagically.
-(void) onEnter
{
[super onEnter];
timer1 = [NSTimer scheduledTimerWithTimeInterval:1/FPS target:self selector:@selector(tick1) userInfo:nil repeats:YES];
timer2 = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(tick2) userInfo:nil repeats:YES];
}
-(void) onExit
{
[timer1 invalidate];
[timer2 invalidate];
[super onExit];
}
-(void) tick
{
// bla bla bla
}
-(void) tick2
{
// bla bla bla
}
it seams to add a few insteresting functionalities that you need when doing 3D programing and you dont want to dig in the code to much.
otherwise as I guessed a sprite is a UIView with extra functionalities ^^
I tend at the moment to try and write the low level stuff by hand and get my own framework of classes and functions going but that a lot of work
maybe if I get round to coco2D you can help me out
best regards
jason