I missed getting to write a blog post about this project but in the midst of moving, I was unable to find time to dedicate to the project. In the past week, I was again struggling to find time to make progress but decided I still wanted to talk about the small amount of work that was done. Going into this week I chose to finally work on cleaning up the player controller code. Early in development, I had been trying to get mechanics in as quickly as possible leading to a player controller file that was hard to parse and difficult to update.
The first step I took to clean this up was to remove parts of the file that weren't being used anymore. One of the mechanics I had created early on in the project was being able to lock on to enemies and have the camera track them. As I continued to develop the project I found this feature didn't fit well with the direction of the project and had disabled it, leaving the functions and variables in the file to avoid having to clean up all references to them or in the case where I wanted to enable the feature in the future.
Another step towards cleaning this file was to move the attack code into a separate file. I've decided that actions the player can take will be components attached to the player instead of built inside the player controller. This will make it easier to change things in the future and should allow me to reuse actions between the player and enemies.
Finally, I made sure to clear out commented-out lines of code and debugging that were no longer needed.
Moving forward with this project I will aim to keep my files less bloated and work on updating other sections to follow the ideas I implemented in this process.
Comments