Day 39: 13 March 2013
23:01: I got two big things completed today. One is the right side ship details panel. It’s pretty cool to see your ship’s stats changing as you add things to it. The second one, as I said yesterday, is the implementation of text boxes. That way, you can type in your ship’s name and hull number. There are potentially an infinite number of other places that the text box can be used in a game like this, too.
It’s amazing, though, what goes into getting stupid little text input box to work. I had to get keyboard input attached to the control, based on whether the control had focus or not. I had to handle drawing the cursor when the text box was selected/active. I had to make sure that wherever you click in the box, it places the cursor there. I had to remap all of the keys in XNA to actual characters. I had to handle backspace and delete in an intelligent manner, as well as the left and right arrow keys.
And really, the text box is still limited/buggy. Really long text will overflow past the end of the control. The hull number box is supposed to only be able to take numbers, but if you put in the symbols on the same keys as the numbers, they’ll work too. Hmm… in fact, now that I’m thinking about it, for the hull number, I think if you use the number pad, it won’t add those key strokes. And then there’s the fact that most people would like to be able to select a whole section of the text in the text box to delete it, or something. That doesn’t work at all.
I’ve been though this before, but you sure do get a better appreciation for the people who build the GUI systems in things like Windows. It’s not trivial.
But I think for now, it’s as good as it needs to be in terms of moving quickly towards a working game. Heck, I probably didn’t even need it at all.
While we’re on the subject of ship names and hull numbers, I’ve had a couple of people wonder what the purpose of it is. Really, both of these come down to you feeling like the ships are yours and yours alone. This, if you remember, is one of the two fundamental principles that I’m using when designing and building this game. A feeling of ownership for the units under your command. I think this will really hit home when, as the mockups suggested, you see a big Revenge of Davy Jones pasted in big letters across the side of your ship. A nameplate, for lack of a better word off the top of my head, is going to be one of the types of objects you can add to your ship. It, of course, will also show up in the user interface.
That’s enough for tonight. It’s late and I’m tired.
Remember: nightly builds can be found here: http://rbwhitaker.wikidot.com/local–files/sprint-review/100XP-Daily.ccgame
Tomorrow, I’ll begin the process of saving/loading ships so that the shipyard and the fleet command screens can be tied together. You’ll finally be able to start building your fleet!