Monday, February 18, 2008
Design Patterns
I've been reading some design pattern posts on gd.net lately and I have come to the conclusion that some of my design choices aren't the greatest. I want to refactor my code to fix these design flaws, but I'm worried that I'll just end up burning myself out and I won't want to finish the game. There are a few smaller things I can fix, but I think I'll have to leave the major ones in for now. Once I have fixed these smaller ones I'll then see if fixing the larger issues is a reasonable choice.
I think the first thing I'm going to work on is removing the FocusComponents. Instead I'll create an interface with the methods that are supposed to be called and then have each menu implement that interface. This is really what I should have done in the first place instead of create a new object to handle the input for each menu. This is mainly be a matter of copy/paste the code in the focus component object into the menu object. It will also make it easier to deal with writing the menus. This way I won't have to jump back and forth between two different classes in order to create or debug a menu.