Monday, July 30, 2012

Level editor update!

Had a nice few hours to work on updating the level editor some more.  It now works similar to the GUI Editor, however I haven't quite gotten it to load up the images and such for the level.  It's taking a bit longer to get that done, but the information is all present and accounted for.  Apparently I somehow messed up and don't have an origin for my scene objects...I guess I assumed upper left hand corner works.  We shall see...

Anyway, it's coming along really well.  I got LOTS done today, along with a few major updates to the level editor.  Despite being major updates, the format hasn't changed, which is great.  But I finally found a way to get an ordered pair together from xml, and it was one of those *facepalm* moments, when it's like "that would work much better than this..."  I kind of set it up like the saving of ordered pairs...which yes, it's obvious that's the best thing to do, but originally I was dealing with individual ordered pairs, rather than vectors.  Now, since I'm working directly with a vector class (which has an x and a y for those of you who don't know) I basically just return a vector once I hit the base case, which is the end element for the given value, like Position, or Scale...

This little move saved me about 100+ lines of code, which is great, but it also allowed for reusable code which is awesome for oop languages.  :-D

Also, I pulled another trick out of my sleeve by extending the parsers to save, as well as load.  I know that's not too different, but this helped me out, because I could override other functions to make them more efficient without directly changing the parser library.  Once I found a good build that works, I just copy pasta back into the library, build it, then move the dll.  ^_^  Worked wonders.

No comments:

Post a Comment