Most optimal way to load 2D world

I am creating a 2D car racing game. (Yes, a Hill Climb Racing clone)

What I am doing right now is load 10% of the map every time the user gets to 7%. For example:

Imagine the map has 10km. (10000m)

When the game starts, the game loads the road from -100m to 1000m.

When the user gets to the 700m (7%) mark, the game deletes 0-500m and loads 1000m to 2000m (10%) (Having loaded from 500m to 2000m).

This will happen every 1000m from now on (1700m, 2700m, 3700m).

I used to create the whole world, and with this new method, I increased my mobile phone fps from 32-34 to stable 60 fps. BUT, every time the user is in the 700m mark, the game freezes for 0.55-0.60 seconds. (When I load/delete the new road).

Is there a better way (In terms of FPS (Performance)) to load the world?

You can find all what you need here Tile maps class, and read the section Rendering Tiled Maps

according to Libgdx docs:

Performance considerations

While we try to make the renderers as fast as possible, there are a few things you can consider to boost rendering performance.

Only use tiles from a single tile set in a layer. This will reduce texture binding. Mark tiles that do not need blending as opaque. At the moment you can only do this programmatically, we will provide ways to do it in the editor or automatically. Do not go overboard with the number of layers.

• So I can use tools like Tiled to generate a world like this? I was doing it using Random class and a mathematical algorithm. Commented Jan 18, 2016 at 9:37
• for sure you can I suggest to read all section on Tile maps
– ZEE
Commented Jan 18, 2016 at 9:39
• Yes !! look you can use it
– ZEE
Commented Jan 18, 2016 at 9:41