Coding C# in Unity
I programmed Krungus on my own in the span of three weeks.
The code I am most proud of is the boss fight logic.
Other important code includes the enemy pathfinding and parrying mechanic.
Download Krungus
Features
- 3D enemy pathfinding and logic
- First person melee combat with parrying, long attacks and slashes, and Undertale-inspired bullet hell scenes
- Tested to run at a smooth 60fps with VSync on lower mid-end devices (tested on Radeon Pro 560, Intel i5 7th gen)
Feedback
Feedback from my programming professor was that Krungus is very polished for a solo project in my first year. My grade on this project was 94.
Code Explanation
Boss fight
A key part of this boss fight was switching to Undertale-esque bullet hell scenes. I combined this with classic boss fight mechanics which appear in Mario games, where you hit a boss out of its stun phase three times to defeat it. Here is a concise explanation of how it worked:
- If the player collides with the boss attack, the
ScenesToLoad
int is increased by 1 - Further collisions are deemed invalid for a time to stop this int accidentally being increased by more than 1 per hit
- This int is used to determine which bullet hell fight is loaded, for instance if int = 2 then scene 2 is loaded
- This results in the player being transported into three scenes in total throughout the boss fight, the 3rd being the final
- I detect when the new scene ends and transport the player and boss back to the original scene
- Now that the bullet hell scene has been completed, the boss is put into a stun phase, allowing it to be attacked
- Three attacks remove it from its stun phase, then once the boss is hit out of its stun phase three times, it is killed
What I would have done differently based on my observations of playtesters
My playtesters did not know to use the block move which made them struggle much more than necessary. To aid this, I would have added an immersive tutorial, such as a tip when the game starts, showing the player how important the block move is.
Other things I would have done differently
I believe that since I was spending all of my time developing Krungus (10∼ hours a day for 2 weeks), it was harder for me to recognize any flaws with the game since I had become used to them.
Coming back to the game today, I recognize flaws which I was blind to during development. This experience made me understand the importance of playtesters for commercial games.
The assets I used were very unoptimized; however, this experience taught me a lot about optimizing my code so I could keep it playable for lower-end devices.
When Unity 6 came out, I updated the game with its new optimization features which further increased frame rates.