Saturday, March 3, 2012

Programming Alone Fri/Saturday

On the GETERDONE spirit, I decided to work a little bit on the PlayTestEnvironment. Lasnight, I wasn't sure what Brady was touching or not, so I decided to not mess too much with it.

My main focus, was to get SOMETHING showing up within the window.

I had to create a MockGame with some MockGameComponents, which all had MockCID,
which are mock composite image definitions.

It was kinda late, so I stopped at about 11 pm cuz I couldn't think and I was getting a bunch of null pointer exceptions.

This morning, I finally got it to draw the 2 penguins and to make them move! Which was a huge success.

I was unsure of how Brady was working with the controller and model, so in the spirit to not ruin that, just in case he was touching them, I decided to make the play test environment cooler.

I added an AboutDeveloper button, basically, you click it and it will pop up a new window which tells you some info about the developer. It shows what they wrote about themselves in the description.

I saw this cool withdrawable item thing within a Grid list. So, I decided to make one. Basically, all you see is the name field for each of the developer's game, and you can hit an arrow to expand and see that particular game's description. I also left it open ended, so you can later rate it based on PowerPenguins (highest 5, lowest 0. but for now, the rating for each game isn't stored anywhere.

IT took me a while to do that however, making the form was pretty different. You basically have to create something extending ListGridRecord, so you can add it to ListGrid. These records have special methods, which work in the form of associating a particular string, to that string's data. So, "name" would be associated with "Checker Penguin" for an instance in the record, yet "name" is also associated with "Risk" in another record instance. I pictured it in my mind, as a sort of mapping of sorts.

In addition, the Record requires a method getFieldAsValue(String field). Which, given "name" will return that particular record's real game.

In retrospect, GWT examples are COOl, but they are poorly commented as to how things work within each other... which would be appreciated; but based on the code, I was able to figure out how to make it work.

All in all, this guy looks pretty cool, IMO.

I also worked on a PenguinIcon for the RuleBook.

No comments:

Post a Comment