Hi, i'm also having some problems with this code (i'm still a new cocos user).
To test my code, i've modified the init-method of 'Parallax2' in ParallaxTest.m (included in the cocos2d tests) to the following:
-(id) init
{
if( (self=[super init] )) {
self.isTouchEnabled = YES;
// background layer: another image
CCSprite *background = [CCSprite spriteWithFile:@"background.png"];
// scale the image (optional)
background.scale = 1.5f;
// change the transform anchor point (optional)
background.anchorPoint = ccp(0,0);
ccTexParams params = { GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT };
[[background texture] setTexParameters:¶ms];
[background runAction:[CCRepeatForever actionWithAction:[CCMoveBy actionWithDuration:5.f position:ccp(-720.f,0.f)]]];
[self addChild:background z:0 tag:kTagNode];
}
Can anyone tell me what i'm doing wrong here?