Making my code neater == Rewriting most of the program. Main menu code doesn't make me cry anymore. Also, I intend to use a fully object oriented approach this time, rather than the mess I made at first. For example, now there is a class MainMenu() which handles the whole of the main menu via methods, rather than the horrible method I was using before of trying to attach a main menu to the game I had made. Also you can use a text file to change button texts
.
It is also now easy for me to add new buildings, creeps, etc. since they are also stored in text files whereas before they were hardcoded (creeps will still be pretty much hardcoded since I have plans for more complex behaviours than just wandering).
Speaking of buildings, here is some outline for how I plan to implement them:
## Name:<Building name>
## Type:<Building type>
## <Type specific fields>
## CostFood:<Food cost of building>
## CostWood:<Wood cost of building>
## CostStone:<Stone cost of building>
## <Other resource costs (for future)>
## Vars:<possible variations of the building image, eg abcde>
## BaseImage:<Path of the sprite, without variation suffix>
## ImageType:<Image format of the sprite, eg .png, .jpg>
## Icon:<Path of building icon>
## Descr:<Short description of the building's use>
I'll write some stuff (copy/paste from the buildings file since I've written lots this time so my brain knows how I want to implement things) about how types and stuff will work if anyone is marginally interested. I intend for this release to take a while before I actually release it, but have a far better game for it. One of the things I want to add is a greater variety of buildings, which is another thing I always intended.
Additionally, I intend to add more types of 'creeps' such as a Builder Creep of some kind that builds lairs for its friends. This in turn could lead to less of a focus on waves and move in a more RTS-y direction with the need to destroy said lairs or fight off many many creeps. I will also try and make the old herding creep work better, as it was a fun idea that I broke when moving from creeps on a white screen to an actual game (when I couldn't think of what to do for coursework).
A lot of this writing is just me braindumping though rather than definite future features, seeing as how I am developing a tendency to walk home from uni thinking of ideas, then forget all about them until I'm next walking home from uni...
As an idea, I currently have a fully functional main menu which looks nice and elegant in code, and is about as customisable without changing code as I can make it. Next up is writing the Map class (and by necessity the Tile class I guess) which will generate a map to a set size, rather than just to the screen size as before.
Yes my cleanup has turned into a rewrite. But its worth it!