I have been working my way though the Player Actions that I had previously coded in one long if statement and am breaking each one out into its own class or function. So far I have the Move and Look functions done, and have started on the Use function.
One of the things that I have been playing with is Inheritance and trying to determine when two classes share enough of the same code that they should inherit stuff from a shared parent. One of the changes that I made was to make Rooms and your Inventory as children of a parent class called Containers. Basically, a Container is a place where you can take or drop things. The difference between a Room and your Inventory is that things can move about in between Rooms.
No comments:
Post a Comment