var tm=0;

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

		this.game.scale.forcePortrait=true;
    	this.game.scale.pageAlignHorizontally = true;
    	this.game.scale.pageAlignVertically = true;
	},

	preload: function(){
		var me = this;
		me.game.load.audio('intro','resources/audio/intro.ogg');
		me.game.load.image('logo','resources/images/logo.png');
		me.game.load.image('iniciar','resources/images/boton1.png');
        //me.load.spritesheet('player', 'resources/images/player.png',243,227);
        me.load.image('index', 'resources/images/index.png');

        
	},

	create: function(){
		var me = this;

		me.backTrack=me.game.add.audio('intro');
        me.backTrack.loop=true;
        me.backTrack.volume=0.6;
        me.backTrack.play();

		me.img = me.game.add.image(80, 85, 'index');
        me.img.width*=0.6;
        me.img.height*=0.6;
        
        me.game.add.image(45,150,'logo');
		me.iniciar=me.game.add.button(45,318,'iniciar',iniciarJuego);
       


	},

	update: function(){
		var me = this;
		tm++;
		

	}

}

function iniciarJuego(){
	Menu.backTrack.stop();
	MyGame.state.start('game');
}
