How to Follow Best Practices AND Keep Your Sanity
Look at that title and tell me that it doesn’t just jump right out at you. That’s exactly what happened to me when I was perusing the library at the school where I work. As you may know, last year I released my first Flash game, Flipnaut, and am currently working on new ones. You may also know that I have been making games professionally since 1996 and that all that experience should mean that I know everything and always follow best practices. You might be right, but that doesn’t mean I am not going to question the theory. I grabbed the book and started reading.
Chris Griffith has written a very useful guide to the many issues developers will often encounter, especially for novices. In the 300 or so pages he covers everything from planning a game project through to debugging a game with plenty of real life examples. Each chapter deals with a different subject, where Chris explains the potential problem, offers various methods to deal with it, and then breaks down how he would solve it. My personal favorite chapter from the book is “Working With Audio” as he not only covers how to deal with sound, he also shows how to use a Singleton Design Pattern. He also exposes some of the bad habits developers have (including myself) such as proper usage of weak references in event listeners. I didn’t even know you could do some of the stuff he shows in the book!
This isn’t to say that the book doesn’t have some issues. I found the order of the chapters to be a bit odd. It does have a logic to it, going from documentation to asset pipeline to making a game, but it seems counterintuitive to me. For example, there is a chapter on math that comes after video and audio systems. Sure, you don’t need math for those two elements, but math is a building block upon which coding relies. I also found that the code examples were at times hard to follow due to the use of long variable names such as previousAcrossTile. While the variables clearly explain what they are doing, it adds up to lots of line drops, which in turn makes hard to track the braces.
Overall, I found this book to be extremely useful. I would recommend this book to anyone who already has some experience working in ActionScript 3 and wants to improve their skills. The sections on error prevention have already had a huge impact on my workflow. If you are just learning AS3, I would suggest holding off until you have a grasp of the fundamentals as this book assumes you understand the basics. I should also add that the book I am reviewing is the first edition and I see that there is a newer, updated version that appears to add a lot more content and covers mobile development. I am excited to check that book out and see how it differs.