Archive for the ‘Uncategorized’ Category

h1

Parsing booleans: a new-fangled invention

April 16, 2008

I’ve made an effort when writing Biff to keep it compatible all the way back to Java 1.4.2. A lot of people still have this old version installed, since it was so popular back in its day (also, GTGE is 1.4.2 compatible, so I thought I’d stick with the engine). I’m running 1.6, but I’m quite aware that not everyone is.

For the most part, this means no enums and a lot of casting objects stored in Vectors. A lack of enum is a bit silly (from the beginning, if you ask me), but can be worked around. And Vectors don’t get used a whole lot, so overall I haven’t regarded this as a big deal.

Take, however, these two extremely similar methods: Integer.parseInt() and Boolean.parseBoolean(). They each take a String and return the equivalent primitive. Obviously very handy when you’re reading sprite data files or whatever as text and you want actual values.

parseInt() has been around forever, and I’ve used it many times, so I was not surprised to find an equivalent in the Boolean class. Except I just noticed that parseBoolean() has only been included since Java 1.5. Why it hasn’t been there from the beginning, I don’t know. Did Sun think that integers are the only values that might occasionally be stored as strings?

The dumb thing, of course, is that as a result Biff needs Java 1.5 to run, despite my attempts to the contrary. And the thing gumming up the works is, of all things, parsing a text file.

h1

Biff says, “It’s time to save the world.”

April 3, 2008

This is a website that will tell you how things are going in the amazing, edge-of-your-seat-exciting world of Biff Hawkins and the Space Whales from Outer Space!

I’ll put up a download here soon, once I’ve got some bugs ironed out. It’ll be fun. I promise. I’ll also put up any neat pictures or music or whatever whenever it gets created.