This commit is contained in:
Brian Fertig 2025-08-27 16:35:47 -06:00
parent b5828b22ec
commit ed5e96d053
10 changed files with 29 additions and 10 deletions

BIN
assets/wizard-a1.mp3 Normal file

Binary file not shown.

BIN
assets/wizard-a2.mp3 Normal file

Binary file not shown.

BIN
assets/wizard-a3.mp3 Normal file

Binary file not shown.

BIN
assets/wizard-b.mp3 Normal file

Binary file not shown.

BIN
assets/wizard-c.mp3 Normal file

Binary file not shown.

BIN
assets/wizard-intro.mp3 Normal file

Binary file not shown.

BIN
assets/wizard-music.mp3 Normal file

Binary file not shown.

BIN
assets/wizard-outro.mp3 Normal file

Binary file not shown.

View File

@ -15,8 +15,8 @@ export class GameScene extends Phaser.Scene {
// Stats // Stats
this.numberOfJewels = 4; this.numberOfJewels = 4;
this.startRows = 5; this.startRows = 2;
this.level = 1; this.level = 12;
this.matchesNeeded = 8; this.matchesNeeded = 8;
this.score = 0; this.score = 0;
this.ally = 'goblin'; this.ally = 'goblin';
@ -65,7 +65,7 @@ export class GameScene extends Phaser.Scene {
this.load.audio('alarm', 'assets/alarm.mp3'); this.load.audio('alarm', 'assets/alarm.mp3');
// Ally Assets // Ally Assets
const allys = ['goblin', 'surfer', 'bear']; const allys = ['goblin', 'surfer', 'bear', 'wizard'];
allys.forEach((ally) => { allys.forEach((ally) => {
this.load.video(`${ally}-resting`, `assets/${ally}-resting.mp4`); this.load.video(`${ally}-resting`, `assets/${ally}-resting.mp4`);
this.load.video(`${ally}-excited`, `assets/${ally}-excited.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.matchesNeeded = newLevel.matchesNeeded;
this.moveInterval = newLevel.moveInterval; this.moveInterval = newLevel.moveInterval;
this.gridColor = newLevel.gridColor; this.gridColor = newLevel.gridColor;
if (newLevel.challenge !== undefined) {
this.clearAndResetBoard();
}
this.LevelText.setText(`Level: ${this.level}`); this.LevelText.setText(`Level: ${this.level}`);
this.sound.play('level-up'); this.sound.play('level-up');
this.sound.play('level-complete'); 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 // Game over function
gameOver() { gameOver() {
console.log('Game Over!'); console.log('Game Over!');

View File

@ -99,31 +99,31 @@ export const LEVEL_CONFIG = {
numberOfJewels: 7, numberOfJewels: 7,
matchesNeeded: 8, matchesNeeded: 8,
moveInterval: 8000, moveInterval: 8000,
ally: 'bear', ally: 'wizard',
spritePlus: 18, spritePlus: 18,
gridColor: 0xFFFFFF gridColor: 0xFFFFFF
}, },
14: { 14: {
numberOfJewels: 8, numberOfJewels: 8,
matchesNeeded: 8, matchesNeeded: 8,
moveInterval: 8000, moveInterval: 9000,
ally: 'bear', ally: 'wizard',
spritePlus: 18, spritePlus: 18,
gridColor: 0xFFFFFF gridColor: 0xFFFFFF
}, },
15: { 15: {
numberOfJewels: 9, numberOfJewels: 9,
matchesNeeded: 8, matchesNeeded: 8,
moveInterval: 8000, moveInterval: 10000,
ally: 'bear', ally: 'wizard',
spritePlus: 18, spritePlus: 18,
gridColor: 0xFFFFFF gridColor: 0xFFFFFF
}, },
16: { 16: {
numberOfJewels: 10, numberOfJewels: 10,
matchesNeeded: 8, matchesNeeded: 8,
moveInterval: 8000, moveInterval: 11000,
ally: 'bear', ally: 'wizard',
spritePlus: 18, spritePlus: 18,
gridColor: 0xFFFFFF gridColor: 0xFFFFFF
} }