Friday, November 18, 2016

Basic Saves Complete! ... To refactor or not refactor...

Character position is now saving and loading properly, and I've played around with some UI elements. As promised, I've removed the 'Build [...]' buttons that were in the last screenshot, and I'm backtracking away from Quill18's work.

The UI buttons may be too fancy. We will see.

New Buttons!
Now, here's my current issue: my hierarchy for constructed objects (fences and misc. furnishings) is woefully unorganized. Quill's tutorial doesn't make use of inheritance, and he calls everything-- even the walls-- furniture in his project. I know I won't keep it like that, but I'm also trying to think of a good, logical structure with idiomatic naming conventions.

So, what does a tree, a rowboat, and a bucket have in common?

None of these things are quite like the other...
Some of these items are man-made. Some aren't.

Some of these things stop characters from walking through. Others will just slow them down.

Some can be equipped. Some are containers for other objects. Some can be cut down (the tree), some can be harvested (the corn). Most will be placed on a tile, but the walls and fences will be aligned to the tile edges. Some can have smaller items stacked on top-- you'd logically want to be able to set things atop a table, for instance.

But! All these things can be interacted with in some way. I want to be able to right click all of them and see a context menu, and I want to left click on them and have them 'selected'. So if I'm to use inheritance (which I think I should), I'm going to need to figure out a natural way to build them. Ideally, this 'tree' will contain minimal amounts of duplicate code.

Spending the day restructuring; we'll see how this goes.

No comments:

Post a Comment