0
votes

I'm creating an android game and using AndEngine. I'm using AutoparallaxBackground to move the background. Background movement is not smooth,its getting stuck and then moving. How to move background smoothly.?

final AutoParallaxBackground autoParallaxBackground = new AutoParallaxBackground(0, 0, 0, 5);
      autoParallaxBackground.addParallaxEntity(new ParallaxEntity(-50.0f, new Sprite(0, 0, this.texRegBg1)));
     autoParallaxBackground.addParallaxEntity(new ParallaxEntity(-60.0f, new Sprite(0, 0, this.texRegBg2)));
     autoParallaxBackground.addParallaxEntity(new ParallaxEntity(-70.0f, new Sprite(0, 0, this.texRegBg3)));
     autoParallaxBackground.addParallaxEntity(new ParallaxEntity(-80.0f, new Sprite(0, 0, this.texRegBg4)));
1
What are the sizes of the texture images you are using? - Khawar Raza
image size is 720x480..texture size is 1024x1024 - user1554336
Hmm... I think the larger size may be the problem. Test with smaller image and see does it improve the smoothness. - Khawar Raza
But i want the background size as 720x480 generally..so it can be used for all devices.. any other way to resolve this issue? - user1554336
On which device you are testing? - Khawar Raza

1 Answers

0
votes
  1. There's a parallax sample included in the AndEngine, please try it on your device and make sure it works smoothly.

  2. Replace one (single!) texture in the parallax sample with your texture and see if it still works smoothly. If it does not -- change and modify your texture until you get it smooth.

  3. Add more textures, one by one. Make them work smoothly.