Game Development Reference
In-Depth Information
Web build of the game and Windows 8 in the same Visual Studio project. I discussed how to
set up Node.js in the previous chapter, so now we can cover how to put it to use.
The first thing we are going to do is clean up all of these JS files all over the place. I am a
little OCD about my project organization, so let's put all of the JavaScript files into a folder
called src. Normally you would put these into the JS folder, but we are going to use Grunt to
actually generate a single JS file for our Windows 8 app to use. Also, move the maze.css file
into the css folder. Now you should have a much cleaner-looking project ( Figure 9-11 ) .
Figure 9-11. Here is what the project structure should look like after we have cleaned up all of the
files.
Next we just need to fix a few paths. If you open up the index.html file you will open it up
and correct the paths to the css file and all the JS files. We will actually end up replacing all
of these JS files with a single minified version once Grunt is up and running, but it's up to
you how your own project could work.
Now let's open up the command line and create a package.json file via NPM. Simply CD in-
to the project's directory and run the following command:
> npm init
Go through the wizard ( Figure 9-12 ) and you should end up with something similar to this:
Search WWH ::




Custom Search