ProjectMobi Player Interactions
Today's message is about breaking down your actions into smaller pieces.
I was looking into some old code that I am redoing for a project I picked back up. The me back then and the me now have changed so much that I am redoing the class and instead changing it into classes.
as you can see above my code had a lot going on and very little of it held the same purpose. Something I learned from some of my interaction with attempting to apply for some back end programming jobs at my current place of work was that it was business to break things down into the smallest jobs.
If it does not have the same purpose then its needs its own class
This is what I am currently working on which is to give a class a specific goal. In the "PlayerInteractions" Class I am simply checking to see if I Clicked, Dragged, or Held the mouse button. I then set a enum state to keep this record. The purpose of this class was to determine if I performed one of the following actions. Which I then passed into a class called "WorldIntercation."
Click, Dragged, Hold
The big change in this approach is that when something breaks you have a detailed list of classes to hunt through and the options within that class should not be overwhelming.
It becomes a bit more work in the beginning with choosing how far to break things down but in the end you have a project that is both easy to work with and if you throw someone else in the mix they do not have to stare are your headache of mess of code.
They can take a smaller Bite.
0.O
I still have a long ways to go till I have a finished game. I look forward to more moments of thought.