Weapons and Power Ups


The next defining feature of the Super Spacewar! is the addition of new weapons and power-ups. The goal was to create as many unique weapon types as I had time for over the course of development. The first new weapon added were homing missiles, which use a simple function to detect when a player is within range, calculate their relative position, and track them until they are out of range, or the missile explodes. Much time was spent dialling in the accuracy and speed of the tracking, and yet somehow, they are still overpowered. It was at this stage that the ability for players to be hit by their own weapons was removed, using layers and collider masks, to allow the new powerups to work correctly.


Next added was the coolest weapon in the game, Matryoshka Missiles ™. These recursive missiles duplicate themselves a specified number of times, scattering in all directions to create a branching area of effect. A modified version of this missile recursion function was used to create two more types of cluster missiles. One launches projectiles in all directions, while the other scatters them in a narrow band. To improve efficiency, an object pool was implemented that fills up as the players fire their weapons, and then recycles those missiles rather than creating and destroying new objects each time.

It was now necessary to add hit points to the player ships, as the likelihood of being hit had increased significantly, and rounds were becoming far too short. A game length limiter (score, lives etc.) was not included at this stage, as I was unsure of which method of tracking rounds would best suit. Lastly, to implement each of these weapons into the game, I added a pickup that drifts through the scene, and supplies a random weapon when collected by a player. It is currently a mystery power-up, as I have not yet created individual icons for each weapon.