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?