Building a Three-Planet Endless Runner Where Gravity Is Different on Every World
Written by Adrian K., Founder & Lead Engineer at Codanum
The Context
Most endless runners reset the world when they reset the run. This client wanted the opposite: a single continuous run that carries the player from Earth to the Moon to Mars, each with its own terrain, gravity, and alien threat density, where the planet changes but the run never stops.
The Challenge
Three planets meant three distinct physics profiles under a single game loop. Earth required full-gravity movement with urban obstacle patterns and dense alien patrol spawning. The Moon demanded low-gravity jump arcs where timing windows are longer but recovery from a mistimed leap is punishing. Mars introduced partial gravity alongside rust-coloured rock formations, dust storms, and the most aggressive patrol AI in the sequence. Each transition had to feel earned, a reward for surviving the previous world, while the procedural generator needed to keep all three zones from feeling repetitive before a run ends.
3
Game Environments
60
Target FPS
The Solution
The architecture was built around a modular procedural generation system managing three separate environment pools (Earth terrain chunks, lunar surface segments, and Martian rock formations), each with a calibrated physics profile and obstacle density curve. Planet-transition triggers adjust gravity parameters and spawn tables in a single frame, so the shift registers immediately without a loading break. Patrol AI scales its aggression per planet, with Martian patrols running tighter pursuit radii and faster reaction times than their Earth counterparts. Custom shaders handle the visual separation: Earth's blue-grey urban atmosphere, the Moon's dust-bleached monochrome, and Mars's rust-orange haze, all targeting 60fps on mid-range Android hardware.
The Impact
The build was delivered on schedule across all contract milestones. All three planetary phases meet playtest targets for feel and difficulty separation, with the Moon-to-Mars transition consistently rated the hardest mechanical jump in testing. The procedural system sustains run variety without predictable repetition up to the point of player failure, achieving the escalating endurance loop the concept set out to create.
"Getting three planets to feel mechanically distinct inside one continuous run was the whole challenge. The gravity tuning on each world is what makes it, you feel the Moon the moment you land there."



