Playing and Building the best 121 Video Game
This is less about game design than it is about sharing programming design notes in building the solitaire game FreeCell using the techniques and methods I found in the book Java 1.4. Game Programming. The book is dated having come out in 2003 when Java 1.4 was new. I may have actually purchased it way back then but it was collecting dust with a couple of books I managed to obtain under the topic "Java Game Programming." I don't think I truly believed those two concepts ever could be in the same sentence (Java and Game Programming) and that is why I went into the C++ and SDL direction.
I prefer Java over C++. I find the C++ syntax cumbersome and overly complex, so much so, that it actually detracts and takes away from the real goal - building some nice code. Now, I will freely admit that maybe just maybe it is related to the fact that I code in Java for a living and have been doing so for several years. The work I do has all been dull back-end stuff of the "get a piece of data from database and display", "update same piece of data" or "get a /28 from that /24 block for this new equipment." Not much excitement but it pays the mortgage. So I decided to pick things up by investigating what it takes to make a game. I spent some time with C++ and SDL, then moved to GameMaker and then was blown away when I saw the things @notch was doing with Java. I decided to switch focus and use the programming language I know and love - Java. So I took a couple of steps in that direction the first one being to start reading (and finish) the book Java 1.4 Game Programming. [Note: After writing this I discovered that the book is available for free online at brinkster.]
I am halfway through chapter 12 (Game Programming Techniques) just before the "Timing in Java" section I decided to take a break and make a game - FreeCell. Why FreeCell. I love the game, I found some decent images on line for a card game, and thought it would be a piece of cake (after all I am a programmer!). Well, it wasn't. Early on I realized I did not know enough about creating GUIs and this project really lends itself to knowing about layouts, components, etc. I decided to cheat and do my very best with the knowledge I had. I also found that I really need to do this exercise - code outside my domain) in order to gain an appreciation for how to actually architect code. Coding and designing a program are two different things! As you can see from the image the game looks like the classic FreeCell game we all wasted time playing while on some boring conference call (not possible today since the company removes all games from the PCs!)
I decided to use the same game framework outlined in the book by Mulholland and Murphy even though I knew I did not need the same game logic since this type of game is more event-driven. Check out my design notes. I get into details covering the same material in book - assuming you don't have the book but it is available rather cheap (used) online and I found I learned many new things in chapters 7 (Threads) - 12 (Game Programming Techniques). This file contains the Eclipse project (all java files and images) I used.
To play the game as a Java Applet head over to this page.
Note: The files referenced on this page shall be uploaded by 7/8/2012. So come back by then if you are truly interested . . . I only ask that you don't throw anything at me (that includes insults on my coding style or pots) but e-mail with advice and suggestions for improvement will be highly appreciated. The applet is available and is subject to change as I complete some items.
-nyguerrillagirl
|