I want some ideas on how to program this class that needs all its variables and properties to be set beforehand for it to work. I was thinking to create an method to set the 3 CCSprite
s. But what about the properties? should I do an NSAssert
to make sure they are set by the user, or is there a better way?
@interface DigParallaxBackgroundLayer : CCLayer
{
CCSprite *background1;
CCSprite *background2;
CCSprite *background3;
}
@property (nonatomic, assign) float bg1ScrollSpeed;
@property (nonatomic, assign) float bg2ScrollSpeed;
@property (nonatomic, assign) float bg3ScrollSpeed;
@property (nonatomic, assign) CGPoint initialOffset;