I picked up my game project again, but I'm putting it back down. I should really listen to my own advice.
So, you know that game project I started just about a year ago, then I stopped working on it? I picked it back up again for a bit... and now I'm putting it back down. I just cannot seem to listen to my own plans / advice. 🤦♂️
Since my last blog post talking about my game project, I decided to work on some of the refactoring changes that I had spoken about before. I never built a level picker or even any other levels. I got a bit too busy and have been too busy with work so unfortunately I never polished this game. In fact, that's where I'm stopping... again (Polish Stage).
I rewrote the code that handles the Wave management and the projectile/boomerang code as well.
I've refactored the code for the enemy wave controller, the UI and the projectile system so that it can be properly unit tested. You can read more about Unit testing and clean code practices by searching up Uncle Bob. The developers of Factorio wrote a blog post talking about clean code practices as well. I figured I could also implement TDD into my personal projects.
[Test]
public void OnWaveStartItQueuesAWaveStartMessage()
{
_stubBroadcaster.StartWave();
AnnouncementMessage currentMessage = _announcementComponent.GetQueue().First.Value;
Assert.AreEqual("Wave #1 Started!", currentMessage.GetMessage());
Assert.False(currentMessage.IsPriority());
Assert.AreEqual(1, currentMessage.GetLifetime());
}
I refactored the boomerang system and the Wave UI system. The boomerang system is functionally the same, but it's been refactored to leverage interfaces more heavily. This allows the components to be loosely coupled. The Wave UI has more components like the enemies remaining and the wave history. Maybe I'll keep working on this project eventually. No promises. 3D might've just been a bad call for a solo project, lol.