Currently, the game uses only global variables and the methods in theMain.py to open and load data. It's become cumbersome to constantly call on the global variables for all my methods and I've realized that I'll be limited in the number of monsters I have if I only use global variables for everything. So this has led me to decide to shift to using Object-oriented programing to run my game. Thus I've prepared a UML diagram to show you all my classes, and subclasses, as well as their interactions, methods, and variables.
GameMenu will be treated as a static class that has information displayed for the game menu as well as the methods for displaying the game menu.
The shop will also be treated as a static class and will have a list of all the items that can be bought as well as their cost. Some items can only be bought once and the shop is the same for all locations so that is why it is static.
Location class will hold the data for specific places that the player has passed by. We will only make new instances of this class as they are needed. It also holds story flags for a said location as well as the location's description.
Combat class has the list of characters in the fight as well as creates character objects for the Monsters. it runs all combat procedures.
Character class has all the basic attributes and methods for both playable characters and monsters. The Monster subclass has the attributes that the monsters use for spawn and buddy rates. Lastly, the Playable Character subclass has all the attributes and methods for our heroes.
Comments
Post a Comment