diff --git a/index.html b/index.html index 75e85c22..a0191dbd 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,19 @@ + + diff --git a/js/badend_scene.js b/js/badend_scene.js index 42550de4..774dffc0 100644 --- a/js/badend_scene.js +++ b/js/badend_scene.js @@ -13,19 +13,17 @@ let BadEndScene = new Phaser.Class({ }, create: function (data) { - this.fromController = data.fromController; + this.fromScene = data.fromScene; // Add background image - if (this.fromController) { + if (this.fromScene === 'controller') { this.add.image(0, 0, 'leavehim').setOrigin(0, 0); } - else { + else if (this.fromScene === "boss") { this.add.image(0, 0, 'badend').setOrigin(0, 0); } - - this.music = this.sound.add('ost_bro_why'); this.music.play(); diff --git a/js/boss_scene.js b/js/boss_scene.js index bc01f0d7..861f653c 100644 --- a/js/boss_scene.js +++ b/js/boss_scene.js @@ -49,7 +49,7 @@ let BossScene = new Phaser.Class({ this.life = 0; clearInterval(this.fireballInterval); this.bossBattleMainMusic.stop(); - this.scene.start('badend_scene'); + this.scene.start('badend_scene', {fromScene: "boss"}); } } }, 1000); @@ -177,7 +177,8 @@ let BossScene = new Phaser.Class({ this.life = 0; console.log("player died"); clearInterval(this.fireballInterval); - this.scene.start('badend_scene'); + this.bossBattleMainMusic.stop(); + this.scene.start('badend_scene', {fromScene: "boss"}); } } diff --git a/js/controller_scene.js b/js/controller_scene.js index cdae9702..e5114820 100644 --- a/js/controller_scene.js +++ b/js/controller_scene.js @@ -51,7 +51,7 @@ let ControllerScene = new Phaser.Class({ console.log("B button clicked"); // go to game over - this.scene.start('badend_scene', {fromController: true}); + this.scene.start('badend_scene', {fromScene: "controller"}); } }); diff --git a/js/sign_scene.js b/js/sign_scene.js index 44ee1f9d..eadc75e6 100644 --- a/js/sign_scene.js +++ b/js/sign_scene.js @@ -26,7 +26,7 @@ let SignScene = new Phaser.Class({ // this.createLifeBar(); // Add try again button - let nextButton = this.add.sprite(850, 500, 'nextbutton').setOrigin(0, 0); + let nextButton = this.add.sprite(950, 500, 'nextbutton').setOrigin(0, 0); nextButton.setInteractive(); nextButton.on('pointerup', () => { diff --git a/js/start_five_scene.js b/js/start_five_scene.js index b61d66fb..8ca8f2e6 100644 --- a/js/start_five_scene.js +++ b/js/start_five_scene.js @@ -21,7 +21,7 @@ let StartFiveScene = new Phaser.Class({ this.createLifeBar(); // Add try again button - let nextButton = this.add.sprite(850, 600, 'nextbutton').setOrigin(0, 0); + let nextButton = this.add.sprite(950, 600, 'nextbutton').setOrigin(0, 0); nextButton.setInteractive(); nextButton.on('pointerup', () => { diff --git a/js/start_four_scene.js b/js/start_four_scene.js index c22d1739..e509ff34 100644 --- a/js/start_four_scene.js +++ b/js/start_four_scene.js @@ -19,7 +19,7 @@ let StartFourScene = new Phaser.Class({ this.music = data.music; // Add try again button - let nextButton = this.add.sprite(850, 600, 'nextbutton').setOrigin(0, 0); + let nextButton = this.add.sprite(950, 600, 'nextbutton').setOrigin(0, 0); nextButton.setInteractive(); nextButton.on('pointerup', () => { diff --git a/js/start_one_scene.js b/js/start_one_scene.js index 7d4179a1..06b44b3e 100644 --- a/js/start_one_scene.js +++ b/js/start_one_scene.js @@ -18,7 +18,7 @@ let StartOneScene = new Phaser.Class({ // Add try again button - let nextButton = this.add.sprite(850, 600, 'nextbutton').setOrigin(0, 0); + let nextButton = this.add.sprite(950, 600, 'nextbutton').setOrigin(0, 0); nextButton.setInteractive(); nextButton.on('pointerup', () => { diff --git a/js/start_three_scene.js b/js/start_three_scene.js index 2a21b1f3..2eebc20b 100644 --- a/js/start_three_scene.js +++ b/js/start_three_scene.js @@ -18,7 +18,7 @@ let StartThreeScene = new Phaser.Class({ this.music = data.music; // Add try again button - let nextButton = this.add.sprite(850, 600, 'nextbutton').setOrigin(0, 0); + let nextButton = this.add.sprite(950, 600, 'nextbutton').setOrigin(0, 0); nextButton.setInteractive(); nextButton.on('pointerup', () => { diff --git a/js/start_two_scene.js b/js/start_two_scene.js index df4590a1..bddaa4b5 100644 --- a/js/start_two_scene.js +++ b/js/start_two_scene.js @@ -19,7 +19,7 @@ let StartTwoScene = new Phaser.Class({ // Add try again button - let nextButton = this.add.sprite(850, 600, 'nextbutton').setOrigin(0, 0); + let nextButton = this.add.sprite(950, 600, 'nextbutton').setOrigin(0, 0); nextButton.setInteractive(); nextButton.on('pointerup', () => {