Skip to content

Commit

Permalink
Create GameOver
Browse files Browse the repository at this point in the history
Agregado el gameover
  • Loading branch information
swbvelasquez committed Oct 24, 2015
1 parent ba491e9 commit ded3bb7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions scripts/states/GameOver
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
function GameOver(game) {}

GameOver.prototype = {
preload: function() {
},
create: function() {

//Fondo de la Introduccion
this.background_menu = this.game.add.sprite(0,0,'background-gameover');
this.background_menu.width=this.game.width;
this.background_menu.height=this.game.height;
//Sonido
this.background_music = this.add.audio('music-gameover', 1, true);
this.background_music.play();

var fontTitle = {
font: '36px "Pokemon Regular"',
fill: '#ffffff',
stroke: '#000000',
strokeThickness: 4
};

this.title = this.add.text(this.game.world.width / 2, 50, 'Game Over :,C', fontTitle);
this.title.anchor.setTo(0.5);

this.buttonPlay = this.game.add.button(this.game.width/2,this.game.height-50,'play-menu',this.playGame,this);
this.buttonPlay.anchor.setTo(0.5,0.5);
this.buttonPlay.scale.setTo(0.5);

console.log('En el GameOver');
//this.state.start('Preloader');
},
update:function(){

},
playGame:function(){
this.background_music.stop();
this.state.start('Game');
}
};

0 comments on commit ded3bb7

Please sign in to comment.