Thursday, March 17, 2016

Refactoring

Refactoring Code

I'm pretty happy with the progress so far. While it may not be anything pretty at this point, it is all at least functioning as expected. I've been taking some time to read up on object oriented programming and am refactoring my code to align with that model. So far I've added in a very basic inventory system which uses inventory slot objects which are extension of basic item objects. The item object can be set with item details, and can display information about the object in an in-game window. The inventory object extends the item object to include a specific inventory slot number. All inventory slot objects get created on game initialization, and the the appropriate slot objects gets updated with item data based on which item should be in that slot. There is still much more work to be done, but this at least give me something to build on.

I'm going back and refactoring my city map code to be an object oriented system as well with each city building being an object that gets loaded with information about the building, and the city being an object with information specific to the city. The city object will contain a method to fill in the city title and background image, then kick off a displayBuilding method from the building objects which will draw their information to the map.

What's Next?

Next I'm going to be spending some time building out the interfaces for some of the buildings. The town hall building should be fairly straight forward, so I'll probably focus on that one first. It should display the current city members as well as the city leadership and what kind of city leadership is in place. (Monarchy, democracy, city council) Once I have that in place I may begin to work out some of the functions to change city leadership types, or perhaps start to work on some of the core game play mechanics such as trading, fighting, or questing.

On The Interwebs!

I have purchased a VPS which I'm planning on running the game on as well as setup a domain name to point to the server. I have not yet loaded the game code up to the server, but I have it somewhat secured at this point. Once I have the game up to a level where I'm looking for some people to do some very basic functionality testing I'll start publishing the code up to the site and keeping it up to date. Until then, enjoy the Apache default page at http://technochimp.tk

No comments:

Post a Comment