Hi All,
I have been working on a Endless Runner game for mobile and web .
Initially i Used TileSprite for the looping background,but it affects the performance on mobile.
Then i used the classic method of moving two backgrounds simultaneously.
But if i increase the speed of the movement , it gives a gap between two backgrounds.
Kindly help me with the logic
bgSpeed = 10
update()
{
mainBg1.y += bgSpeed;
mainBg2.y += bgSpeed;
if(mainBg1.y >= this.game.height)
{
mainBg1.y = -this.game.height;
}
if(mainBg2.y >= this.game.height)
{
mainBg2.y = -this.game.height;
}
}