title: Semantic JavaScript singleton with constructor
body: <p>So I'd like to have a class called <code>client</code> which will be the base of a video game I'm writing in JavaScript.</p>
  
  <p><code>client</code> should be a class that there can only be one instance of, but its first creation should be set by myself at a specific event, like when the user clicks the "start" button.</p>
  
  <p>I made myself a singleton class and I'm starting it unload just for testing:</p>
  
  <pre><code>// Singleton class for the client
  var client = (function() {
  
    // Public methods
    var _this = {
      construct: function() {
        delete _this.construct;
        _this.director = new lime.Director(document.body, window.innerWidth, window.innerHeight); // Setup the rendering engine
      }
    }
    return _this;
  })();
  
  // Fire when dependencies are loaded
  window.onload = client.construct;
  </code></pre>
  
  <p><strong>The problem:</strong></p>
  
  <p>But I intend for this to be an open source project and on the last line <code>client.construct</code> seems to be a highly unusual convention. How can I write my singleton class so that it will be constructed with <code>new Client</code> and can never be constructed again?</p>