Escape the Sun (Play In Browser)

Escape the sun is an infinite runner aimed at mobile where you have to try and run away from the sun which is constantly expanding, taking up more space. You move by launching from planets and landing on planets (hopefully further away than the last).

The game uses custom physics to handle gravitational pulls around planets that the player can use to sling shot around planets. There was originally terrible programmer art and since I'm better at code than drawing I used procedural generation to get the computer to do all of my art, explained in more detail below.


  • Infinite level length
  • Procedurally generated planets
  • Custom Gravitational Physics
  • Google Play Leaderboards

Planet generation workflow

To create the planets for the game I decided to use procedural generation to create the art, since I'm not much of an artist. The planets are generated once on my computer then processed to generate a spherical projection which is then rendered as an orthographic projection of the planet and exported with other planets in a spreadsheet for use in the game.

In slightly more detail I used this example of wrapping world map generation inside Unity as a starting point for the planet generation and modified it (see here) so that it could batch generate and save the biome maps to disk.

Now with a folder full of wrapped spherical planets there needs to be a way for taking the 2D images and wrapping it around a sphere. Luckily NASA has been hard at work solving this for composite images of actual planets like mars. Using their G.Projector program which transforms images using a variety of projections (orthographic worked well in this case). For each planet theme I exported between 9 and 20 planets from G.Projector which could be used in game.

The final step of the process involves taking the G.Projector planets and picking a few which don't look similar to put into the sprite map used in the game. This narrowed down the total planets of each type to 8 and made awesome looking art (for a programmer).