The Last Stand
The Last Stand is the final for my second term Artcenter coding class, in which I was challenged to make an arcade-like game in two weeks. I took inspiration from Missile Control to make a top down survival shooter, where you control an immobilized mech and defend yourself against huge waves of robotic enemies.
This game is interesting, because I stepped firmly outside my comfort zone while making it. Making an enemy wave system was especially difficult, due to me never having done something like that before. I quickly encountered a dilemma; I needed enemies to come from all angles in a natural-feeling way, but for that I would need a spawn point that existed at a lot of different locations at once. If I simply placed a lot of spawn points in a circular way offscreen, it would choke up code immensely with unnecessary variables.
The most natural solution to this was a spawn point that moved around, but to get the spawn point to move in a circle around the player would require too much time– I needed something simpler, something that could be done without too much effort. After fiddling with some other systems to multitask, I decided to leverage Unity's parenting system to get the effect I wanted. It ended up working amazingly well.
First, I parented the spawning object to an "empty", which mostly serves as a non-entity, great for these exact purposes. Then, I moved the spawn point far out of view. After designing a simple script that made the empty object rotate quickly every frame, I checked in on the spawning point. Sure enough, as the empty rotated, so did the spawner, as if it was on a cart on a ferris wheel. Happy with the result, I added logic to the spawning that made enemies spawn in random bunches, randomized the spawn times, and polished up the game.
It ended up working like a charm. The enemies come in at completely organic angles at unpredictable intervals, never once feeling like one direction is more favored than another. Moreover, they always ended up grouping into tight clusters, perfect prey for an explosive blast. In a way, this hacky solution ended up being one of the best solutions I could have implemented. The alternatives would have taken ages, the game's development cycle would have been far more rushed as a result, and the end result would have been much lesser. Turns out, this problem was an excellent lesson to work smarter, not harder.