text: (function() {
     var Boot = function(game) {
        this.zoomed = false;
        this.debugText = "";
        var gameWidth;
        var gameHeight;
  
        if (window.innerWidth * window.devicePixelRatio > window.innerHeight * window.devicePixelRatio) {
           gameWidth = window.innerWidth * window.devicePixelRatio;
           gameHeight = window.innerHeight * window.devicePixelRatio;
        } else {
           gameWidth = window.innerHeight * window.devicePixelRatio;
           gameHeight = window.innerWidth * window.devicePixelRatio;
        }
  
        TDG.GAME_WIDTH = gameWidth;
        TDG.GAME_HEIGHT = gameHeight;
  
        // ipad pro resolution as base
        var BASE_WIDTH = 2732;
        var BASE_HEIGHT = 2048;
  
        TDG.GAME_SCALE_Y = (TDG.GAME_HEIGHT/BASE_HEIGHT);
        TDG.GAME_SCALE_X = (TDG.GAME_WIDTH/BASE_WIDTH);
        TDG.BASE_SPEED = (TDG.GAME_WIDTH / 60);
        TDG.LOCKED = false;
  
        //dev
        //TDG.GB_SPEED_OFFSET = 1;
        //ionic
        TDG.GB_SPEED_OFFSET = 1;
        //itch.io
        // TDG.GB_SPEED_OFFSET = .72;
  
     };
     Boot.prototype = {
        init: function() {
           this.input.maxPointers = 1;
  
           this.scale.pageAlignHorizontally = true;
           this.scale.pageAlignVertically = true;
  
           if (!this.game.device.desktop) {
              this.scale.forceOrientation(true, false);
              this.scale.setResizeCallback(this.gameResized, this);
              this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this);
              this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this);
           }
        },
        preload: function() {
           this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
           this.game.load.audio('gunshot', 'audio/gunshot.wav');
           this.game.load.atlasJSONHash('scene', 'images/sprite-sheet-1.png', 'images/sprite-sheet-1.json');
           this.game.load.image('background', 'images/bg1.jpg');
           this.game.load.image('bullet', 'images/purple_ball.png');
           this.game.load.image('scope', 'images/scope.png');
           this.game.load.image('menu-bg', 'images/bg1.jpg');
           this.game.load.image('title-backdrop', 'images/title-backdrop.png');
           this.game.load.image('intro-text', 'images/intro-text.png');
           this.game.load.image('zoom-out-icon', 'images/zoom-out-icon.png');
           this.game.load.spritesheet('start-button', 'images/start.png', 791, 263);
           this.game.load.spritesheet('introstart-button', 'images/introstart.png', 791, 280);
           this.game.load.spritesheet('quit-button', 'images/quit.png', 786, 261);
           this.game.load.spritesheet('back-button', 'images/back.png', 799, 280);
           this.game.load.spritesheet('levels-button', 'images/levels.png', 791, 280);
           this.game.load.spritesheet('playagain-button', 'images/playagain.png', 786, 261);
        },
        create: function() {
           this.game.state.add('main', TDG.Main);
           this.game.state.add('main-menu', TDG.MainMenu);
           this.game.state.add("level-menu", TDG.LevelMenu);
  
           this.game.state.start('main-menu', true, false);
        },
        update: function() {},
        gameResized: function(width, height) {
           //  This could be handy if you need to do any extra processing if the game resizes.
           //  A resize could happen if for example swapping orientation on a device or resizing the browser window.
           //  Note that this callback is only really useful if you use a ScaleMode of RESIZE and place it inside your main game state.
        },
        enterIncorrectOrientation: function() {
           TDG.orientated = false;
           document.getElementById('orientation').style.display = 'block';
        },
        leaveIncorrectOrientation: function() {
           TDG.orientated = true;
           document.getElementById('orientation').style.display = 'none';
        },
        render: function() {
           // game.debug.text("Click to toggle! Sorting enabled: " + sorted, 2, 36, "#ffffff");
           // this.game.debug.text((this.game.time.fps || '--') + TDG.GAME_WIDTH + ", " + TDG.GAME_HEIGHT, 2, 14,
           // "#a7aebe");
  
           //debug points
           // var point = new Phaser.Rectangle( game.world.centerX, game.world.centerY, 25, 25 ) ;
           // game.debug.geom( point, 'rgba(255,0,0,1)' ) ;
  
           // var point = new Phaser.Rectangle( 200.5, 400.5, 25, 25 ) ;
           // game.debug.geom( point, 'rgb(56, 230, 154)' ) ;
  
           // var point = new Phaser.Rectangle( 0, 0, 25, 25 ) ;
           // this.game.debug.geom( point, 'rgb(71, 111, 241)' ) ;
  
           // var point = new Phaser.Rectangle( 0, this.gameHeight-25, 25, 25 ) ;
           // this.game.debug.geom( point, 'rgb(71, 111, 241)' ) ;
        }
     };
  
     TDG.Boot = Boot;
  })();