Friday, July 24, 2009

Rehash

Just a quick update; in working with my code, I realized that it was time to clean up some of its mess. I've been splitting some of the classes up and taking advantage of inheritance, etc. This may take a few days to finish (and to make sure that I've not introduced any new bugs), but this single (large) act, will expand functionality between objects, agents, and environment tiles. It's a bit frustrating, but also rewarding.

2 comments:

droid factorial said...

Yeah, I just finished a 7drl where I had an actor class and a player class that inherited from the actor class.
Usually I would get something working in the player class, realize it was more general, then push up most of the stuff that wasn't UI. Refactoring happens, and it is better that it happen early than too late.

abagoforanges said...

Cool, about your 7DRL. After putting this project down during my last semester and then picking it up again, I realized that I'd need to consolidate things and move stuff around. I guess I've just been putting it off, as it was more instantly rewarding to add some new feature. I've just gotten to the point where the classes were MUCH too large, and I had classes with similar data, etc. I'm like, "Hmm, all of my world object classes need to use an interface that forces them to declare the method, "isInFreeFall"... and then I realized that the basic code for all of this would be the same, with just extra things added on; like how agents (with sufficient reaction) would be able to hang if they fell.)

It seems so obvious to me now. Oh well, it's really a learning project for me, so I should expect for this to happen.