top of page

Planet Hopper

A 3D platformer where you hop from planet to planet trying to survive as long as possible by granning oxygen tanks.

Download Link

Planet Hopper Planets.gif

Coding gravity for any planet

This was definetly a challenge. I wanted to make a game that had planets where you could move around in like in Mario Galaxy. At first I thought of just making the player rotate so that their feet always point to the center of the planet, but there was an issue with this, I didn't want to just have spherical planets, I wanted planets to have a variety of different shapes that the player could stil easily walk on. What I ended up doing was shooting a raycast from the player to the center of the planet, and getting the normal vector from the surface of the planet. That way even if the planet has a weird topology the player will always be perpendiuclar to the ground.

Planet Hopper Cube Planet.gif

Rotating Planets

I also wanted to make some planets be able to rotate. While that part was easy, making the player stick to the rotating planet was harder. Since I was moving the player through Unity's physics system, simply parenting the player to the planet wouldn't work. In the end the soultion wasn't too complicated, simply rotate the player with the same angular velocity as the planet.

Increasing the skill ceiling

Since the game is about hopping from planet to planet I wanted the player to be able to use their momentum to their advantage. That would allow them to go very fast if the fall to a planet at just the right angle. That's why I made it so that if you move in the direction you're moving you don't lose speed. The reason I often like momentum based gameplay is because it usually helps to increase the skill ceiling, making the game more replayable and rewarding.

Planet Hopper Gif.gif

It's also possible to fall into orbit! This isn't a functionality I specifically coded for, it's just an organic behaviour that emerges from how the physics work.

Planet Hopper Orbit - Made with Clipchamp.gif
bottom of page