diff --git a/assets/Cutscene/ransom.png b/assets/Cutscene/ransom.png new file mode 100644 index 0000000..65234a5 Binary files /dev/null and b/assets/Cutscene/ransom.png differ diff --git a/src/scenes/Cutscene1.js b/src/scenes/Cutscene1.js index 68de5f0..6360e16 100644 --- a/src/scenes/Cutscene1.js +++ b/src/scenes/Cutscene1.js @@ -9,6 +9,9 @@ export class Cutscene1 extends Phaser.Scene { this.load.image('emily-paper-2', 'assets/Cutscene/emily-paper-2.png'); this.load.image('luke-worried', 'assets/Cutscene/luke-worried.png'); this.load.image('luke-wanted', 'assets/Cutscene/luke-wanted.png'); + this.load.image('ransom', 'assets/Cutscene/ransom.png'); + + this.load.audio('cutscene-1', 'assets/music/cutscene-1.mp3'); } create() { @@ -18,6 +21,11 @@ export class Cutscene1 extends Phaser.Scene { background.scaleY = this.scale.height / background.height; background.setScrollFactor(0); + // Background Music + this.bgMusic = this.sound.add('cutscene-1', { volume: 0.5 }); + this.bgMusic.loop = true; + this.bgMusic.play(); + // Fade in camera this.cameras.main.fadeIn(1000, 0, 0, 0); @@ -84,6 +92,7 @@ export class Cutscene1 extends Phaser.Scene { const cap4 = this.typewriterEffect('What is it Bootstrap??!!',800,800); this.time.delayedCall(4000, () => { cap4.destroy(); + luke1.destroy(); const luke2 = this.add.image( 1100, 400, @@ -96,7 +105,58 @@ export class Cutscene1 extends Phaser.Scene { duration: 500, yoyo: true, onComplete: () => { - const cap5 = this.typewriterEffect("The 99 Boys have Fat Hawk. We have to rescue him!",800,800); + const cap5 = this.typewriterEffect("The 99 Boys have Fat Hawk. We gots to rescue him!",800,800); + this.time.delayedCall(4000, () => { + cap5.destroy(); + emily2.destroy(); + luke2.destroy(); + const ransom = this.add.image( + 800, + 400, + 'ransom' + ).setOrigin(0.5).setScale(0.2).setAlpha(0.2); + ransom.postFX.addGlow(); + this.tweens.add({ + targets: ransom, + angle: 5, + scale: .5, + alpha: 1, + duration: 500, + onComplete: () => { + const cap6 = this.typewriterEffect("Better head up North East into the Gulch and into their LAIR!!", 800, 800); + this.time.delayedCall(5000, () => { + cap6.destroy(); + const cap7 = this.typewriterEffect("Press SPACE to Continue", 800, 800); + // Add keyboard input + this.input.keyboard.on('keydown-SPACE', () => { + // Fade out music + this.tweens.add({ + targets: this.bgMusic, + volume: 0, + duration: 1000, + ease: 'Linear', + onComplete: () => { + // Stop the music after fading out + this.bgMusic.stop(); + + // Fade out camera + const fadeOut = this.tweens.add({ + targets: this.cameras.main, + alpha: 0, + duration: 1000, + ease: 'Linear', + onComplete: () => { + // Start the next scene after both effects complete + this.scene.start('Gulch'); + } + }); + } + }); + }); + }); + } + }); + }); } }); });