{"size": 2714, "ext": "js", "max_stars_repo_path": "src/states/boot.js", "max_stars_repo_name": "lgcon/Street-Money", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/states/boot.js", "max_issues_repo_name": "lgcon/Street-Money", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/states/boot.js", "max_forks_repo_name": "lgcon/Street-Money", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.2467532468, "max_line_length": 100, "alphanum_fraction": 0.6805453206}
//Create the boot state
var boot = {
	init: function(){
			//First of all, resize the game and make it responsive
			this.scale.scaleMode = Phaser.ScaleManager.USER_SCALE;
			this.scale.setMinMax(200,100,1200,750);	
			this.scale.pageAlignHorizontally = true;
			this.scale.setResizeCallback(this.onResizeCallback,this);
		
			if (!this.game.device.desktop){
				this.scale.forceOrientation(true, false);
				this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this);
	    	    this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this);
			}
			//Get host name
		/*	var reg1 = new RegExp('^https?:\/\/');
			var reg2 = new RegExp('\/[^\/]*$');
			game.host = (window.location != window.parent.location)? 
					document.referrer.replace(reg1,'').replace(reg2,'') : window.location.host;
		*/
			game.host = window.location.host;
		},
	onResizeCallback: function(){
			var scale = Math.min(window.innerWidth / this.game.width, window.innerHeight / this.game.height);
			this.scale.setUserScale(scale,scale,0,0);
		
		},
	enterIncorrectOrientation: function(){
			 document.getElementById('orientation').style.display = 'block';
			 document.getElementById('game').style.display = 'none';
			 this.game.paused = true;
		},
	leaveIncorrectOrientation: function(){
			 document.getElementById('orientation').style.display = 'none';
			 document.getElementById('game').style.display = 'block';
			 this.game.paused = false;
		},
	preload: function(){
			//Load game configuration
			this.load.text('conf','./config.json');
			//We load the image for the loading bar
			this.load.image('preloadbar','assets/images/preloader-bar.png');
			//And the image to ask for landscape
			this.load.image('rotatescreen','assets/images/rotatescreen.png');
			//Set physic system	
			this.physics.startSystem(Phaser.Physics.ARCADE);
			//Turn on sounds
			this.game.soundOn = true;
		},
	create: function(){
			this.game.input.maxPointers = 2;
			//Parse game configuration file
			game.conf = JSON.parse(this.game.cache.getText('conf')); 	
			//Some easier path
			game.textFont = game.conf.textfont.name;
			game.textstyle = game.conf.text_styles;
			if (!localStorage.lastUnblockedLevel)
				localStorage.setItem('lastUnblockedLevel',1);
			game.current_lev = parseInt(localStorage.lastUnblockedLevel);
			//Load google web fonts
			WebFont.load({
				google: {
					families: [game.conf.textfont.family]
				},
				active: function(){
					/*if (game.host == "www.fgl.com" || 
					    game.host == "4998.s.time4vps.eu" ||
					    game.host == "localhost") 
					*/
						//Change state when complete (make sure the font has loaded)
						game.state.start('Load');
				}
			}); 
		}
};

