diff --git a/assets/menu-99-boy.png b/assets/menu-99-boy.png new file mode 100644 index 0000000..0bccba1 Binary files /dev/null and b/assets/menu-99-boy.png differ diff --git a/assets/menu-background.png b/assets/menu-background.png new file mode 100644 index 0000000..edfb539 Binary files /dev/null and b/assets/menu-background.png differ diff --git a/assets/menu-cult-of-protec.png b/assets/menu-cult-of-protec.png new file mode 100644 index 0000000..1d3ed39 Binary files /dev/null and b/assets/menu-cult-of-protec.png differ diff --git a/assets/menu-fathawk-fly-1.png b/assets/menu-fathawk-fly-1.png new file mode 100644 index 0000000..79416e7 Binary files /dev/null and b/assets/menu-fathawk-fly-1.png differ diff --git a/assets/menu-fathawk-fly-2.png b/assets/menu-fathawk-fly-2.png new file mode 100644 index 0000000..08b14b6 Binary files /dev/null and b/assets/menu-fathawk-fly-2.png differ diff --git a/assets/menu-fathawk-land.png b/assets/menu-fathawk-land.png new file mode 100644 index 0000000..db529cb Binary files /dev/null and b/assets/menu-fathawk-land.png differ diff --git a/assets/menu-logo.png b/assets/menu-logo.png new file mode 100644 index 0000000..0f04088 Binary files /dev/null and b/assets/menu-logo.png differ diff --git a/assets/menu-protec-close.png b/assets/menu-protec-close.png new file mode 100644 index 0000000..a23e688 Binary files /dev/null and b/assets/menu-protec-close.png differ diff --git a/assets/menu-quantum-boy.png b/assets/menu-quantum-boy.png new file mode 100644 index 0000000..1c66e92 Binary files /dev/null and b/assets/menu-quantum-boy.png differ diff --git a/assets/menu-sheriff-emily.png b/assets/menu-sheriff-emily.png new file mode 100644 index 0000000..2249e28 Binary files /dev/null and b/assets/menu-sheriff-emily.png differ diff --git a/assets/music/99Dungeon.mp3 b/assets/music/99Dungeon.mp3 new file mode 100644 index 0000000..7326547 Binary files /dev/null and b/assets/music/99Dungeon.mp3 differ diff --git a/assets/music/99Dungeon2.mp3 b/assets/music/99Dungeon2.mp3 new file mode 100644 index 0000000..a645160 Binary files /dev/null and b/assets/music/99Dungeon2.mp3 differ diff --git a/assets/sounds/hawk-call.mp3 b/assets/sounds/hawk-call.mp3 new file mode 100644 index 0000000..e78da90 Binary files /dev/null and b/assets/sounds/hawk-call.mp3 differ diff --git a/src/main.js b/src/main.js index 566ae23..710db95 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,4 @@ -// import { MenuScene } from './scenes/MenuScene.js'; +import { MenuScene } from './scenes/MenuScene.js'; import { Gulch } from './scenes/gulch.js'; import { NNDungeon } from './scenes/NNDungeon.js'; // import { L2Scene } from './scenes/L2Scene.js'; @@ -21,6 +21,7 @@ const config = { }, scene: [ + MenuScene, Gulch, NNDungeon ] diff --git a/src/scenes/MenuScene.js b/src/scenes/MenuScene.js new file mode 100644 index 0000000..2fdc8ed --- /dev/null +++ b/src/scenes/MenuScene.js @@ -0,0 +1,142 @@ +export class MenuScene extends Phaser.Scene { + constructor() { + super({ key: 'MenuScene' }); + } + + preload() { + this.load.image('background', 'assets/menu-background.png'); + this.load.image('logo', 'assets/menu-logo.png'); + this.load.image('fathawk-fly-1', 'assets/menu-fathawk-fly-1.png'); + this.load.image('fathawk-land', 'assets/menu-fathawk-land.png'); + this.load.image('sheriff', 'assets/menu-sheriff-emily.png'); + this.load.image('NNBoy', 'assets/menu-99-boy.png'); + this.load.image('QBoy', 'assets/menu-quantum-boy.png'); + this.load.image('ProTec', 'assets/menu-cult-of-protec.png'); + this.load.audio('menu-music', 'assets/music/gulch-2.mp3'); + this.load.audio('hawk-call', 'assets/sounds/hawk-call.mp3') + } + + create() { + // Add background image + const background = this.add.image(0, 0, 'background').setOrigin(0, 0); + background.scaleX = this.scale.width / background.width; + background.scaleY = this.scale.height / background.height; + background.setScrollFactor(0); + + // Add logo with initial scale of zero + const logo = this.add.image( + this.scale.width / 2, + this.scale.height / 2.4, + 'logo' + ).setOrigin(0.5).setScale(0); + + const fathawkFly = this.add.image( + this.scale.width * 1.1, + this.scale.height / 8.5, + 'fathawk-fly-1' + ).setScale(0.1); + + const sheriff = this.add.image( + this.scale.width / 6.5, + this.scale.height * 1.3, + 'sheriff' + ).setScale(0.4); + + const ProTec = this.add.image( + this.scale.width * .65, + this.scale.height * 1.3, + 'ProTec' + ).setScale(0.4); + + const NNBoy = this.add.image( + this.scale.width * .75, + this.scale.height * 1.3, + 'NNBoy' + ).setScale(0.4); + + const QBoy = this.add.image( + this.scale.width * .9, + this.scale.height * 1.3, + 'QBoy' + ).setScale(0.4); + + // Background Music + this.bgMusic = this.sound.add('menu-music', { volume: 0.5 }); + this.bgMusic.loop = true; + this.bgMusic.play(); + + // Animate the logo to grow and spin, then return to original scale + this.tweens.add({ + targets: logo, + scale: 1.2, + delay: 1000, + duration: 3000, + ease: 'Power2', + onComplete: () => { + this.tweens.add({ + targets: logo, + scale: 1.0, // Return to original size + angle: 0, // Reset the rotation + duration: 1000, + ease: 'Power2', + onComplete: () => { + + } + }); + this.sound.play('hawk-call'); + this.tweens.add({ + targets: fathawkFly, + scale: .2, + x: this.scale.width / 3.5 , + y: this.scale.height * .9, + duration: 2000, + ease: 'Power1', + onComplete: () => { + fathawkFly.setTexture('fathawk-land'); + this.tweens.add({ + targets: sheriff, + y: this.scale.height * .85, + duration: 1000, + ease: 'Power1', + onComplete: () => { + this.tweens.add({ + targets: ProTec, + y: this.scale.height * .9, + duration: 1000, + delay: 0, + ease: 'Power1', + }); + this.tweens.add({ + targets: NNBoy, + y: this.scale.height * .85, + duration: 1000, + delay: 500, + ease: 'Power1', + }); + this.tweens.add({ + targets: QBoy, + y: this.scale.height * .78, + duration: 1000, + delay: 1000, + ease: 'Power1', + }); + } + }); + } + }); + } + }); + + this.add.text( + this.scale.width / 2, + this.scale.height * (9 / 10), + 'Press SPACE to start', + { fontSize: '32px', fill: '#fff' } + ).setOrigin(0.5); + + this.input.keyboard.on('keydown-SPACE', () => { + this.bgMusic.stop(); + this.scene.start('Gulch'); + }); + } +} \ No newline at end of file diff --git a/src/scenes/NNDungeon.js b/src/scenes/NNDungeon.js index 5ac7008..4959f38 100644 --- a/src/scenes/NNDungeon.js +++ b/src/scenes/NNDungeon.js @@ -34,7 +34,7 @@ export class NNDungeon extends Phaser.Scene { frameHeight: 100 }); - this.load.audio('gulchMusic', 'assets/music/gulch.mp3'); + this.load.audio('dungeonMusic', 'assets/music/99Dungeon.mp3'); this.load.audio('gunShot', 'assets/sounds/gun-shot.mp3'); this.load.audio('axeThrow', 'assets/sounds/axe.mp3'); this.load.audio('99boy-defeat-0', 'assets/sounds/zombie-death-1.mp3'); @@ -202,7 +202,7 @@ export class NNDungeon extends Phaser.Scene { this.cameras.main.setBounds(1600, 2700, 1600, 900); // Background Music - this.bgMusic = this.sound.add('gulchMusic', { volume: 0.5 }); + this.bgMusic = this.sound.add('dungeonMusic', { volume: 0.5 }); this.bgMusic.loop = true; this.bgMusic.play(); } diff --git a/src/scenes/gulch.js b/src/scenes/gulch.js index e64ed48..9b421f8 100644 --- a/src/scenes/gulch.js +++ b/src/scenes/gulch.js @@ -123,6 +123,7 @@ export class Gulch extends Phaser.Scene { player.takeDamage(); }); this.physics.add.collider(this.player, this.NNDungeon, (player, zone) => { + this.bgMusic.stop(); this.scene.start('NNDungeon'); });