Insterstellar Inferno

Made with: Unity, C# for PC

Solo project

Module ‘Building Playful Worlds’ - 8 weeks

Dec 2023

Functionality

For this project, I developed a top down roguelike shooter game. On each planet, you need to kill an increasing amount of robots, and more stronger robots appear the further you get. The robots grant xp when killed and can drop guns, health pickups and powerups, and the stronger the robots the better the rewards. There are 3 abilities that you unlock at certain leves: a teleport dash, a lifesteal powerup and ultra rapid fire. Once you kill all monsters on a planet, the teleporter activates and when entered brings you to the next planet.

Development process

This was the first proper Unity project we got and the first proper Unity game I made. I wanted to make something special, so I decided to make it a planet crawling adventure set in space. This came with some additional challenges, like simulating gravity. During this project I learned a lot about Unity, and did a lot of things I’d never done before, like:

  • Animations

  • Custom physics

  • Roguelike mechanics

  • Custom keykinds

  • Random loot drops

I was really happy with how many new things I learned while working on this project, I definitly feel like I improved a lot in Unity over these 8 weeks.

Technical Overview

The code is mostly not that interesting here, back when I made this project we hadn’t yet learned about a lot of programming patterns and code conventions, but there are some interesting things worth highlighting:

  • Because the planets are round, the ground has depth instead of being flat. Normally, for aiming, you would raycast onto the ground, and then rotate the player in that direction. But because of the depth difference, if you would do that on a planet, you would aim into the ground if you hover over a part of the planet that’s lower. To fix this, instead I would draw a line forward from the player, and a line from the player to where the mouse hit the ground, calculate the angle between the lines, ignore the Z, and rotate the player along that angle. Nothing super complicated, but it was really cool to me at the time when I finally solved it.

  • Unity has a physics engine, with simulated gravity, but that one always pulls you down (or up if you set it to a positive number). I needed to be pulled towards the center of the planet you’re on, and so did the bullets and enemies, so I had to develop a system where each object had a certain amount of mass and used this mass to calculate how much it should attract other things. Again, nothing special, but as I’d never done anything with physics before, I found it really interesting to figure out how it might work.

Next
Next

Cog in the Machine