Hello!
I move the Sky.png from left to right and I want to loop the sky moving. I mean when right edge if the Sky texture hides then it appears on left side.
My code is
@implementation MyLayer
- (id) init
{
...
s = [Sprite spriteWithFile:@"Sky.png"];
[s setPosition:ccp(160, 380)];
ccTexParams params;
params.wrapS = GL_REPEAT;
params.wrapT = GL_REPEAT;
[s setTexParameters:¶ms];
[self addChild:s];
}
- (void) gameStep: (ccTime)delta
{
[s setPosition:ccp(x, 380)];
s += 0.25;
}
@end
What is wrong with it?
Thanks