var GameOver = {
	init: function(){
		var me = this;

		this.game.scale.forcePortrait=true;
    	this.game.scale.pageAlignHorizontally = true;
    	this.game.scale.pageAlignVertically = true;
    	document.getElementById("anuncios").style.height = "15%";
	},

	preload: function(){
		localStorage.ACorp_Dinero=(localStorage.ACorp_Dinero||0);
		var me = this;
		me.game.load.audio('error','resources/audio/error.ogg');
		me.game.load.image('imgPerdiste','resources/images/loser.png');
		me.game.load.image('perdiste','resources/images/perdiste.png');
		me.game.load.image('boton','resources/images/again.png');
	},
	create: function(){
		var me = this;
		me.game.add.audio('error').play();

		me.bobo=me.game.add.image(20,60,'imgPerdiste');
		me.bobo.width*=0.6;
		me.bobo.height*=0.6;

		me.game.add.image(5,160,'perdiste');
		me.game.add.button(25,270,'boton',resetear);
		if(localStorage.ACorp_Dinero<puntuaje){
			me.game.add.text(30, 420, 'NUEVO RECORD!: '+puntuaje, {font: "30px Trebuchet MS", align: "left"}).fill="White";
			localStorage.ACorp_Dinero=puntuaje;
		}
		else{
			me.game.add.text(90, 410, 'Puntaje: '+puntuaje, {font: "25px Trebuchet MS", align: "left"}).fill="White";
			me.game.add.text(90, 440, 'Record: '+localStorage.ACorp_Dinero, {font: "25px Trebuchet MS", align: "left"}).fill="White";
		}

	},
	update: function(){
		var me = this;
	}
}

function resetear(){
	puntuaje=0;
	MyGame.state.start('game');
}