diff --git a/assets/2015 Cruiser.ttf b/assets/2015 Cruiser.ttf deleted file mode 100644 index 4384a1e..0000000 Binary files a/assets/2015 Cruiser.ttf and /dev/null differ diff --git a/assets/beach-music.mp3 b/assets/beach-music.mp3 new file mode 100644 index 0000000..1090415 Binary files /dev/null and b/assets/beach-music.mp3 differ diff --git a/assets/clear.mp3 b/assets/clear.mp3 new file mode 100644 index 0000000..a59a8f2 Binary files /dev/null and b/assets/clear.mp3 differ diff --git a/assets/goblin-music.mp3 b/assets/goblin-music.mp3 new file mode 100644 index 0000000..b3dbfa8 Binary files /dev/null and b/assets/goblin-music.mp3 differ diff --git a/assets/level-up.mp3 b/assets/level-up.mp3 new file mode 100644 index 0000000..ea51a43 Binary files /dev/null and b/assets/level-up.mp3 differ diff --git a/assets/switch.mp3 b/assets/switch.mp3 new file mode 100644 index 0000000..070ec71 Binary files /dev/null and b/assets/switch.mp3 differ diff --git a/src/GameScene.js b/src/GameScene.js index 7c18c14..f60757c 100644 --- a/src/GameScene.js +++ b/src/GameScene.js @@ -39,13 +39,24 @@ export class GameScene extends Phaser.Scene { } preload() { + // Jewels this.load.spritesheet('jewels', 'assets/jewels.png', { frameWidth: 100, frameHeight: 100 }); + + // Fonts this.load.font('cruiser', 'assets/NEUROPOL.ttf'); this.load.font('code', 'assets/CodePredators-Regular.otf'); + // Music + this.load.audio('goblin-music', 'assets/goblin-music.mp3'); + this.load.audio('beach-music', 'assets/beach-music.mp3'); + this.load.audio('clear', 'assets/clear.mp3'); + this.load.audio('level-up', 'assets/level-up.mp3'); + this.load.audio('switch', 'assets/switch.mp3'); + + // Ally Videos this.load.video('goblin-resting', 'assets/goblin-resting.mp4'); this.load.video('goblin-excited', 'assets/goblin-excited.mp4'); this.load.video('goblin-pleased', 'assets/goblin-pleased.mp4'); @@ -61,6 +72,11 @@ export class GameScene extends Phaser.Scene { this.physics.add.collider(this.jewels, this.jewels); this.createStart(); + // Background Music + this.bgMusic = this.sound.add('goblin-music', { volume: 0.5 }); + this.bgMusic.loop = true; + this.bgMusic.play(); + // Create the score text this.scoreText = this.add.text(20, 50, 'Score: 0', { fontFamily: 'cruiser, arial', @@ -328,6 +344,7 @@ export class GameScene extends Phaser.Scene { } // Set swapping flag to prevent new clicks from being processed this.isSwapping = true; + this.sound.play('switch'); // Disable all jewel interactivity temporarily this.jewels.children.iterate((jewel) => { @@ -387,6 +404,7 @@ export class GameScene extends Phaser.Scene { this.matchesNeeded = newLevel.matchesNeeded; this.moveInterval = newLevel.moveInterval; this.LevelText.setText(`Level: ${this.level}`); + this.sound.play('level-up'); // Create the New Level text const newLevelText = this.add.text(1150, 250, `Level ${this.level}`, { @@ -559,6 +577,8 @@ export class GameScene extends Phaser.Scene { } }); + this.sound.play('clear'); + // Animate destruction jewelsToDestroy.forEach((jewel) => { this.tweens.add({ diff --git a/src/config.js b/src/config.js index 9eeeb96..7e35a18 100644 --- a/src/config.js +++ b/src/config.js @@ -13,5 +13,30 @@ export const LEVEL_CONFIG = { numberOfJewels: 5, matchesNeeded: 12, moveInterval: 11000 + }, + 4: { + numberOfJewels: 5, + matchesNeeded: 12, + moveInterval: 10000 + }, + 5: { + numberOfJewels: 5, + matchesNeeded: 12, + moveInterval: 9000 + }, + 6: { + numberOfJewels: 5, + matchesNeeded: 12, + moveInterval: 8000 + }, + 7: { + numberOfJewels: 5, + matchesNeeded: 12, + moveInterval: 7000 + }, + 8: { + numberOfJewels: 5, + matchesNeeded: 12, + moveInterval: 6000 } };