I don't want to make a scrolling background b/c it's too confusing so I decided to make a scrolling ground, which is an object, to make it look like my actor is moving.
How would I make it so that the ground (Ground.class) could keep remaking itself? However I want it so that there are gaps in between so the actor can jump over the gap.
Please help. I tried many ways but it lags a lot b/c I used counters and the counter eventually got to big (greater than 2000....)
I then called it in the world's act() method so that this would keep repeating itself.
Anyway to make it better? or provide a scenario that has a scrolling object (ground)
public void createContinualPlatform() { counter++; if (counter > 500 && counter <= 600) { grassPlain = new GrassPlain(); addObject(grassPlain, 800, 230); } if (counter > 600) { counterNext++; if (counterNext > 30 && counterNext <= 200) { grassPlain = new GrassPlain(); addObject(grassPlain, 800, 384); } if (counterNext > 230 && counterNext <= 350) { grassPlain = new GrassPlain(); addObject(grassPlain, 800, 230); if (counterNext == 350) counterNext = 0; } } }