Hey developers !
I got a new problem, who is actually very difficult to resolve for me. Well, my problem is very easy to explain, I hope you'll understand (my english is very bad, sorry for this) ; So, I got two CCSprites who are backgrounds. Here are the initials positions of my backgrounds:
fond.position = ccp (size.width/2, 960);
fond2.position = ccp(size.width/2, 0);
In the init method, I call a tick method :
// schedule a repeating callback on every frame
[self schedule:@selector(nextFrame:)];
And here is the tick method :
fond2.position = ccp(fond2.position.x, fond2.position.y + decalFonds);
fond.position = ccp(fond.position.x, fond.position.y + decalFonds);
if (fond2.position.y >= 480 && fond.position.y >= 1440) {
fond.position = ccp(fond.position.x, -480);
}
if (fond.position.y >= 480 && fond2.position.y >= 1440) {
fond2.position = ccp(fond.position.x, -480);
}
DecalFonds is an int value who is equal to 5. So, my two backgrounds moves up and when the background of the bottom moves too up, the upper background comes down the background of the bottom so that we can't see the background of the app: This is a loop who always show a background moving to the up. I hope you understood, tell me if not. And the problem is that if you test this code with two CCSprites sizing 960*320 (both), you'll see that a little line with the color of the layer of the scene appear at each loop : looks like there is one pixel entrer the two CCSprites, so this is what I tried : I tried to stack the two backgrounds (about 10pixels on the up and down edges), but the line still appear ! I am really confused, what am I supposed to do ?
Thanks in advance for your help !