Chapter 2 of Game Development by Example goes into making a small but very impressive tile flipping puzzle game with chapter 3 adding the polish and finishing touches to the completed game. The project hits on sprites and spritesheets; it puts a little design work into place that separates the game into more classes than the one bloated Game.cs class many small games like this use; finally, it gets the game all the way to a final playable point in a fun show your friends state. I am incredibly impressed with the complexity and quality of the game that comes out of chapters 2 and 3 with only a few small notes about things I would have done differently:
- Separate more of the functionality from the Game class into its own classes or into existing but better suited ones
- Drawing the game board should be part of the existing GameBoard class, not the Game class
- Each Draw of the pieces should also be in the class for that piece. This one is REALLY obvious as the method names even have the name of each piece class in them.
- Font and text related rendering could easily be separated for easier understanding of the whole code base
- Flood related functionality is borderline hitting enough code to be separated out. Not needed as bad as the above parts though
- An enumerated type and a bool would be more suitable to the choosing of game pieces from the spritesheet (instead of the list of constant strings with a “W” at the end when filled in with water)
- Queues in the UpdatePieceTypePieces methods add unneeded complexity to the picture. The same functionality can be accomplished with a simple List<string>.
As I mentioned above, the overall outcome of the project in chapters 2 and 3 is leagues ahead of what you would normally see coming out of the early chapters (or in some cases any chapters) of many other XNA books out there. Hopefully the high quality output continues in future chapters.
Book Link: http://link.packtpub.com/ZWicAE