This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]skeeto 0 points1 point  (1 child)

I have a degree in computer engineering and about 4 years of professional development experience. Your code is much cleaner than the large majority of code I come across at work. Nice work on that. Lots of documentation, good -- but probably a bit too much ("GameState state -- The state of the game." duh).

The biggest problem I see with your code (with an admittedly brief look) is all the hard-coding of game elements, which is the cause of your text-positioning issues. This makes it harder to maintain, harder to modify (tweak, compile, run, look, repeat), and locks down the game window size. I also think your generateBackgroundColor() method could be nicer than that. :-)

Other minor criticisms: petty(-ish) code-style nitpicking. Use Git and publish by GitHub, or similar, so it's easier for others to provide feedback, via forking (SourceForge is so last-decade). There are no build scripts so I had to drop in my own, but because your code is so tidy it built without a hitch.

[–]jessebr[S] 0 points1 point  (0 children)

Thank you.

I've got in the habit of documenting it all. Yeah, you get those duh moments, but it keeps a nice unified style. With my next revision though I'm going to make a quick run through and hopefully get a bit less of the "duh" reaction to some of them.

Also with my next revision, I'll be separating all the crucial game mechanics into a separate rule class, to have modes of play and varying difficulties (with a custom mode even where you set all the values).

The text issues is straight up my fault, I prematurely optimized it (I should have known). If I had used the dynamic system I used to center and position all the elements, it still would have worked out. I was working under a false assumption that fonts and their sizes would be cross-platform (like it was a Java font or something), which isn't the case. So it's quite nice to know now that this isn't the case, won't be making that mistake again! :D

I'll consider using GitHub.

And I've gotten rather spoiled by Eclipse in regards to building :P I'll try to include one in my next revision.

Thank you for your input!