diff --git a/assets/wizard-a1.mp3 b/assets/wizard-a1.mp3 new file mode 100644 index 0000000..8ee824c Binary files /dev/null and b/assets/wizard-a1.mp3 differ diff --git a/assets/wizard-a2.mp3 b/assets/wizard-a2.mp3 new file mode 100644 index 0000000..5882e8a Binary files /dev/null and b/assets/wizard-a2.mp3 differ diff --git a/assets/wizard-a3.mp3 b/assets/wizard-a3.mp3 new file mode 100644 index 0000000..7442a93 Binary files /dev/null and b/assets/wizard-a3.mp3 differ diff --git a/assets/wizard-b.mp3 b/assets/wizard-b.mp3 new file mode 100644 index 0000000..ef9eb89 Binary files /dev/null and b/assets/wizard-b.mp3 differ diff --git a/assets/wizard-c.mp3 b/assets/wizard-c.mp3 new file mode 100644 index 0000000..7281aa8 Binary files /dev/null and b/assets/wizard-c.mp3 differ diff --git a/assets/wizard-intro.mp3 b/assets/wizard-intro.mp3 new file mode 100644 index 0000000..c25a861 Binary files /dev/null and b/assets/wizard-intro.mp3 differ diff --git a/assets/wizard-music.mp3 b/assets/wizard-music.mp3 new file mode 100644 index 0000000..50906fe Binary files /dev/null and b/assets/wizard-music.mp3 differ diff --git a/assets/wizard-outro.mp3 b/assets/wizard-outro.mp3 new file mode 100644 index 0000000..f4f50e5 Binary files /dev/null and b/assets/wizard-outro.mp3 differ diff --git a/src/GameScene.js b/src/GameScene.js index 73cf471..7ff2d4e 100644 --- a/src/GameScene.js +++ b/src/GameScene.js @@ -15,8 +15,8 @@ export class GameScene extends Phaser.Scene { // Stats this.numberOfJewels = 4; - this.startRows = 5; - this.level = 1; + this.startRows = 2; + this.level = 12; this.matchesNeeded = 8; this.score = 0; this.ally = 'goblin'; @@ -65,7 +65,7 @@ export class GameScene extends Phaser.Scene { this.load.audio('alarm', 'assets/alarm.mp3'); // Ally Assets - const allys = ['goblin', 'surfer', 'bear']; + const allys = ['goblin', 'surfer', 'bear', 'wizard']; allys.forEach((ally) => { this.load.video(`${ally}-resting`, `assets/${ally}-resting.mp4`); this.load.video(`${ally}-excited`, `assets/${ally}-excited.mp4`); @@ -1069,6 +1069,9 @@ export class GameScene extends Phaser.Scene { this.matchesNeeded = newLevel.matchesNeeded; this.moveInterval = newLevel.moveInterval; this.gridColor = newLevel.gridColor; + if (newLevel.challenge !== undefined) { + this.clearAndResetBoard(); + } this.LevelText.setText(`Level: ${this.level}`); this.sound.play('level-up'); this.sound.play('level-complete'); @@ -1124,6 +1127,22 @@ export class GameScene extends Phaser.Scene { }); } + clearAndResetBoard() { + // Destroy all existing jewels + this.jewels.children.iterate((jewel) => { + if (jewel) { + jewel.destroy(); + } + }); + + // Clear the jewels group + this.jewels.clear(true, true); + + // Bring in 2 fresh rows + this.startRows = 2; + this.createStart(); + } + // Game over function gameOver() { console.log('Game Over!'); diff --git a/src/config.js b/src/config.js index 4f3c0a9..e4181e3 100644 --- a/src/config.js +++ b/src/config.js @@ -99,31 +99,31 @@ export const LEVEL_CONFIG = { numberOfJewels: 7, matchesNeeded: 8, moveInterval: 8000, - ally: 'bear', + ally: 'wizard', spritePlus: 18, gridColor: 0xFFFFFF }, 14: { numberOfJewels: 8, matchesNeeded: 8, - moveInterval: 8000, - ally: 'bear', + moveInterval: 9000, + ally: 'wizard', spritePlus: 18, gridColor: 0xFFFFFF }, 15: { numberOfJewels: 9, matchesNeeded: 8, - moveInterval: 8000, - ally: 'bear', + moveInterval: 10000, + ally: 'wizard', spritePlus: 18, gridColor: 0xFFFFFF }, 16: { numberOfJewels: 10, matchesNeeded: 8, - moveInterval: 8000, - ally: 'bear', + moveInterval: 11000, + ally: 'wizard', spritePlus: 18, gridColor: 0xFFFFFF }