Quick Update 1: The Equip Menu

|

Not bad, huh?

Above you'll see a comparison of the Equip Menu in Earthbound, and in Javabound, which I just finished. It works perfectly, even adjusting your offense and defense appropriately, and showing you how those two stats will change if you equip a different item.

The right-hand window is shorter, displaying only 5 items instead of Earthbound's six. But honestly, only one character in Mother 1 has six different items to equip, and one will only be cut off if you're deliberately trying to collect them all. So honestly, it's not needed.

Javabound's menus auto-sort the list of items you can equip, by the way. The most powerful item (like the Gold ring) is at the top, with the worst at the bottom.

I'm off to finish the Goods menu next, which should be much easier.

Working on Menus

|

The exact opposite of Giygas. Oh, and the Setup menu so far.

I've started to work on the menus in Javabound. The first attempt looked very nice, but it got more complicated as things went along, particularly since the classes designed so far were not really built with these menus in mind.

So after redoing the Person, Fighter, and Item classes (the biggies) and also cleaning out the main Game class, we have the screenshot above. Nothing too impressive, but the windows know to move the cursor back to the top if you try to move it past the bottom.

Here's one aspect of the windows in Earthbound which made drawing the windows in Javabound much easier, but I didn't notice it at first:


It's a GRID!


Yes, in Earthbound the windows are snapped to a grid of 8-pixel squares.

In addition, the height of each window in pixels is equal to:
(the number of lines of text + 1 ) * 16

Or in Java, we can do a faster bit shift, since 16 = 2^4
(the number of lines of text + 1 ) << 4

So to make a Window in Javabound like the upper-right one in the above screenshot, I call:

new Window(12,1,19,3);
12 grid squares from the left
1 square from the top
19 squares wide
Enough room for 3 lines of text

The parameters are handled like so:
Multiply 12 by 8 (or bitshift 12 << 3) to get the top-left corner's distance from the left (96 pixels)
Do the same thing for 1 to get the top-left corner's distance from the top (8)
Same for 19, to get its width (152)
As for the 3 lines of text, (3 lines + 1) * 16 = 64 pixels, the window's height

This makes windows much easier to handle. Consider the Equip menu, where one window is positioned right up against another. Previously, I had to find the precise pixel values and draw the windows until they were lined up, in attempt to stay true to the original game.

But now, doing that is much easier.