Game Development Reference
In-Depth Information
Modularize Your Code
While it's easy to test if WinJS exists when your game starts up, you may want to avoid
adding in lots of branching logic for each platform. This could easily get out of control if you
start to support other platforms like PhoneGap for mobile distribution or online game portals.
Try to keep each platform's code in its own module, plugin, or JavaScript file, which you can
load based on what platform the game is running on.
Test Regularly
The one thing that can happen is that you tend to ignore doing a Windows 8 build. One of the
greatest advantages of JavaScript is the fact that you don't have to compile it. For the most
part, this workflow is designed to keep your productivity high by being able to simply hit re-
fresh in the browser without needing to compile. Theoretically, whatever you can get to run
on the Web should run fine on Windows 8, but make sure you do regular builds just to make
sure.
Use Automation
With either an Apache setup or a Node.js one, you can easily set up automation scripts to
maintain a Windows 8 and Web build of your game. For Apache setups I rely on Ant, and for
Node.js I use Grunt. In Chapter 9 I will go over an automation solution I used for a simple
HTML5 game that I got running on Windows 8.
Search WWH ::




Custom Search