Ladies and Gentlemen, we have a HUD


Every time I click ‘run,’ there’s a very high chance that the program will throw some sort of exception. And, since I’m a n00b, there is a likelihood not statistically different from 100%, that the exception will be a nullPointerException. I don’t know why. Apparently, every time I declare a new variable, I have this annoying tendency to forget to initialize it. Considering I initialize all instance variables to null, and then just tell myself that I will initialize them in the constructor (or elsewhere), I just forget. In the case of this HUD, there are some arrays that are supposed to be, basically, null. At least for the time being. So I have a subroutine that generates sprites to render and if it doesn’t find anything there that needs rendering, it throws a nullPointerException. I fixed it though. The program no longer tries to generate sprites if nothing is there to be generated.

Anyway, what I wanted to say, was that, since I’m always expecting the program to crash on load, when it doesn’t and, indeed, works exactly how I want it to, my heart does this weird little leap and there is a sharp intake of breath. It’s pretty neat. I’m shocked and then elated. And then I remember there’s so much more work to do.

What you’re seeing here on the right is the worker-placement board. This is important since this is, technically, a worker-placement game. It’s the place where the players take turns choosing actions to perform each round. It looks complicated, but it isn’t. The super neat thing is that the action-board renders independently of the game board. I can move the game board around and the action board stays still. There are two or three more things to add to the UI and then I can start implementing more functionality. And little things like game rules.

Ich wünschte, du wärst schöner zu Tieren.

One thought on “Ladies and Gentlemen, we have a HUD

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.