In the gameScene background moving horizontally it's working fine but i want to move background slow and fast according to score increasing, i proceed this way with nstimeinterval changing but nothing i can see change the background moving slow and fast its just going normal, if this way is wrong someone help me please.
SKTexture *backgroundTexture = [SKTexture textureWithImageNamed:@"background10"];
NSTimeInterval _move;
int _gameScore;
if (_gameScore>=5) {
_move =0.09;
}else{
_move = 0.02;
}
SKAction *movBg = [SKAction moveByX:-backgroundTexture.size.width*2 y:0 duration:_move*backgroundTexture.size.width];
SKAction *resetBg =[SKAction moveByX:backgroundTexture.size.width*2 y:0 duration:0];
SKAction *movebackgroundforever =[SKAction repeatActionForever:[SKAction sequence:@[movBg,resetBg]]];
for (int i= 0; i<2 + self.frame.size.width/(backgroundTexture.size.width*2 ); ++i) {
SKSpriteNode* sprite = [SKSpriteNode spriteNodeWithTexture:backgroundTexture];
[sprite setScale:1.0];
sprite.zPosition = -20;
sprite.anchorPoint = CGPointZero;
sprite.position = CGPointMake(i* sprite.size.width, 0);
[sprite runAction:movebackgroundforever];
[_bgLayer addChild:sprite];