The next set of changes that we'll need to make on the original game code is in the
game class. As you'll remember, this class defines a basic game life cycle, exposing the functions
render, which get implemented by whoever uses it.
Since the core of the game loop defined in this class (found in
window.requestAnimationFrame, we'll need to get rid of that call since it will not be available in Node.js (or in any other environment outside the browser).
One technique that is commonly used to allow us the flexibility to write a single module that is used in both the browser and the server is to wrap the browser- and server-specific functions in a custom module.
Using Browserify, we can ...