text: 
  /* Game namespace */
  var game = {
  
      // an object where to store game information
      data : {
          // score
          score : 0
      },
  
  
      // Run on page load.
      "onload" : function () {
          // Initialize the video.
          if (!me.video.init(640, 480, {wrapper : "screen", scale : "auto", scaleMethod : "flex-width"})) {
              alert("Your browser does not support HTML5 canvas.");
              return;
          }
  
          
          // Initialize the audio.
          me.audio.init("mp3,ogg");
  
          // set and load all resources.
          // (this will also automatically switch to the loading screen)
          me.loader.preload(game.resources, this.loaded.bind(this));
          me.state.change(me.state.LOADING);
      },
  
      // Run on game resources loaded.
      "loaded" : function () {
          me.state.set(me.state.MENU, new game.TitleScreen());
          me.state.set(me.state.PLAY, new game.PlayScreen());
  
          // set a global fading transition for the screen
          me.state.transition("fade", "#FFFFFF", 250);
  
  
          // add our player entity in the entity pool
          me.pool.register("mainPlayer", game.PlayerEntity);
          me.pool.register("CoinEntity", game.CoinEntity);
          me.pool.register("EnemyEntity", game.EnemyEntity);
          me.pool.register("BarrierEntity", game.BarrierEntity);
          
  
          // enable the keyboard
          me.input.bindKey(me.input.KEY.DOWN,  "down");
          me.input.bindKey(me.input.KEY.UP, "up");
          me.input.bindKey(me.input.KEY.RIGHT,  "right");
          me.input.bindKey(me.input.KEY.LEFT, "left");
  
  
          // Start the game.
          me.state.change(me.state.MENU);
  
      }
  };
  
  