It's been a long time, and quite a busy semester. Thankfully it didn't go all without programming: here's my homework for this semester, written in Java this time. It's a rather shameless clone of Z-Type. I've had this game bookmarked for a long time, I'm not sure how well-known it actually is. Here's the blog post from the author when they've published it back in the January of 2011.
The concept is fairly simple. The game consists of enemy ships appearing at the top of the screen, coming towards your ship that's on the bottom. Every enemy has a word written on it, typing out the letters of their words in order will shoot projectiles at them, destroying them upon completing the word. Your objective is to type words fast enough that you destroy the ships coming towards you before they can reach you. As you progress the levels, the number and size of the ships increases, the larger ones also having longer words for you to type.
Features and usage
Let's go by the structure of the menu.
The Resume button only works when you have a game saved, and does the obvious thing.
The Play button can be used to start a new game at any time. Starting a new game will erase whatever game you have paused/saved currently. You can pause the game anytime while playing by pressing the Escape key (or by closing the game window, if you really want to).
There's not much explaination to the actual game, all you have to do is type the words you see appearing on the screen. You only have to use the letter keys, you don't need to type spaces or hit enter at any time in the game. Once you start typing a word, you can't type letters other than the next letter in that word, until the targeted ship is defeated. If there are multiple ships with the same first letter on the screen, the closer one will be targeted.
Under Stats, you can find your high scores as well as kill counts for ships killed in the game. This menu also displays a word per minute ratio based on your games (keep in mind that it's not designed to be compared with other typing tests' results).
The intricate details of the Exit button are up to you to discover on your own.
While it had its ups and downs, all the coding was pretty straightforward. My worst hours of work were a result of nothing but Eclipse being rather special. Java was okay to use after I got the hang of it, not having cross-include problems ever is really neat. Feels like you can just throw everything together, and it just works. Performance hasn't been a problem with a project of this complexity either.
The final graphic design is very close to the one that I used through testing, and while I was planning to get more detailed and closer to the original, I got used to how it looked, so I only gave it a bit of a polish at the end.
If for whatever reason you find the default 400 by 825 dimensions of the game unsuitable, you can pass two space separated integers as command line parameters - in the order width, height - to override them. Playing it in widescreen is actually pretty cool, since the words are much less likely to end up on top of each other.
The default word set contains the words collected by this GitHub project, which I have filtered for not safe for work and capitalized words the best I could.