Final Game and Conclusion

What I Built and How I Did It

Throughout the development process, I got to work across nearly every Unity system:

  • Scripting: I wrote dozens of custom scripts using to manage weapons, enemies, player controls, pickups, and more. I also used coroutines for actions like rolling invulnerability or UI transitions, and relied on Unity events to communicate between systems (like triggering win conditions when all enemies are dead). 



  • Input & Vectors: I implemented the new Input System, allowing for both keyboard and arcade stick integration. Movement and aiming are handled using vectors to rotate the player or calculate bullet direction with precision.



  • Physics: All movement and combat use Unity’s 2D physics engine. I configured rigidbodies, colliders, and triggers to manage everything from bullet impacts to object pushing. Careful layer setup and tag filtering helped prevent unwanted collisions (like enemies accidentally killing each other).




  • Graphics & Audio: I integrated sprites, tilemaps, and audio clips. Guns now have firing sounds, windows make a sound when breaking, and background music (really cool drum and bass). I didn’t go too deep in this part since I was more focused on the core mechanics and left this part for the last minute.




  • Animation: I used Unity’s Animator Controller system to manage the player’s armed/unarmed states, and walking animations. The transitions feel smooth and responsive. Like last section, I didn't focus too much on this part.



  • Game Architecture: This was perhaps the biggest challenge. I restructured the weapon system using a base class (GunBase) and inherited classes for each weapon type. I followed SOLID principles (as much as I could and remembered) to separate responsibilities and prevent code duplication. I also created a central "EnemyManager" to track enemy count, and the system now feels modular and expandable. Adding new guns is easier at this point. I could have done the same for enemies, but I ran out of time and I didn't think about it enough to be honest.

  • Game AI: I built two distinct enemy types (ranged and melee) using finite-state machines. The AI makes use of 2D NavMesh Agents for pathfinding, combined with raycasting to handle line-of-sight logic. They behave intelligently: ranged units only shoot when they can see you, melee enemies chase you down, and they all stop targeting if you escape the room.

  • User Interface: Finally, I built all the necessary UI elements: a Main Menu, Pause Menu, Victory/Defeat screens, and a dynamic HUD that displays ammo and enemy count in real time. It is really simple and not visually attractive to be honest. However, the main focus here is learning how to implement the logic behind it, and the aesthetic will come later.

Wrapping Up

To wrap it all up, I tested the final build on the arcade machine, and almost everything worked smoothly. The majority of the controls were responsive, the menus navigable, and the game played well from start to finish. The only issue I ran into was with the "Lock and Aim" mechanic: due to the hardware’s 8-directional joystick, the player would occasionally get stuck when holding the lock button (or that's my hypothesis hahaha). I’m not entirely sure if it’s an input reading or rotation issue, but unfortunately, I ran out of time to fix it. Everything else, though, worked like a charm. Below are some pictures of how the final game looks and the scene in the Unity Editor.







Comentarios

Entradas populares de este blog

Enemy AIs, UI logic and Adjusting Weapons Architecture

Core Gameplay Prototype