title: Splitting javascript into several files
body: <p>I have some javascript code which is basically</p>
  
  <pre><code>$( document ).ready(function() {
      // Global variable definitions
      // Bunch of functions depending on variables
  });
  </code></pre>
  
  <p>Is there any way for me to split these functions up into several files even though they are all mostly dependent on each other?</p>
  
  <p>I'm creating a html5 game and I want to separate a lot of the code, for example I'd like code for drawing objects to be in a specific file, code for updating the game state in another file and so on so I can still access all the global variables.</p>
  
  <p>Is there a way to do this without a lot of hassle or rewriting all the code?</p>