Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared-Sprague committed Apr 30, 2019
1 parent 2fcbcc9 commit 83f6f2c
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 14 deletions.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
<script src="js/lobby_scene.js"></script>
<script src="js/goodend_scene.js"></script>
<script src="js/sign_scene.js"></script>

<style>
canvas {
padding: 0;
margin: auto;
display: block;
/*width: 800px;*/
}

body {
background-color: black;
}
</style>
</head>
<body>

Expand Down
8 changes: 3 additions & 5 deletions js/badend_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
5 changes: 3 additions & 2 deletions js/boss_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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"});
}
}

Expand Down
2 changes: 1 addition & 1 deletion js/controller_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"});
}

});
2 changes: 1 addition & 1 deletion js/sign_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion js/start_five_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion js/start_four_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion js/start_one_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion js/start_three_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion js/start_two_scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 83f6f2c

Please sign in to comment.