A bunch of polish
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 2.4 MiB |
|
After Width: | Height: | Size: 915 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 980 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 2.0 MiB |
|
|
@ -1,4 +1,4 @@
|
||||||
// import { MenuScene } from './scenes/MenuScene.js';
|
import { MenuScene } from './scenes/MenuScene.js';
|
||||||
import { Gulch } from './scenes/gulch.js';
|
import { Gulch } from './scenes/gulch.js';
|
||||||
import { NNDungeon } from './scenes/NNDungeon.js';
|
import { NNDungeon } from './scenes/NNDungeon.js';
|
||||||
// import { L2Scene } from './scenes/L2Scene.js';
|
// import { L2Scene } from './scenes/L2Scene.js';
|
||||||
|
|
@ -21,6 +21,7 @@ const config = {
|
||||||
|
|
||||||
},
|
},
|
||||||
scene: [
|
scene: [
|
||||||
|
MenuScene,
|
||||||
Gulch,
|
Gulch,
|
||||||
NNDungeon
|
NNDungeon
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ export class NNDungeon extends Phaser.Scene {
|
||||||
frameHeight: 100
|
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('gunShot', 'assets/sounds/gun-shot.mp3');
|
||||||
this.load.audio('axeThrow', 'assets/sounds/axe.mp3');
|
this.load.audio('axeThrow', 'assets/sounds/axe.mp3');
|
||||||
this.load.audio('99boy-defeat-0', 'assets/sounds/zombie-death-1.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);
|
this.cameras.main.setBounds(1600, 2700, 1600, 900);
|
||||||
|
|
||||||
// Background Music
|
// 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.loop = true;
|
||||||
this.bgMusic.play();
|
this.bgMusic.play();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ export class Gulch extends Phaser.Scene {
|
||||||
player.takeDamage();
|
player.takeDamage();
|
||||||
});
|
});
|
||||||
this.physics.add.collider(this.player, this.NNDungeon, (player, zone) => {
|
this.physics.add.collider(this.player, this.NNDungeon, (player, zone) => {
|
||||||
|
this.bgMusic.stop();
|
||||||
this.scene.start('NNDungeon');
|
this.scene.start('NNDungeon');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||