Add levelling up mechanics through experience gained via killing enemies

This commit is contained in:
Peter Stockings
2026-01-04 18:36:31 +11:00
parent 42cd77998d
commit 29e46093f5
11 changed files with 373 additions and 84 deletions

View File

@@ -61,7 +61,8 @@ vi.mock('phaser', () => {
vi.mock('../../rendering/DungeonRenderer', () => ({
DungeonRenderer: vi.fn().mockImplementation(function() {
return {
initializeLevel: vi.fn(),
initializeFloor: vi.fn(),
computeFov: vi.fn(),
render: vi.fn(),
showDamage: vi.fn(),
@@ -78,7 +79,8 @@ vi.mock('../../engine/simulation/simulation', () => ({
}));
vi.mock('../../engine/world/generator', () => ({
makeTestWorld: vi.fn(),
generateWorld: vi.fn(),
}));
vi.mock('../../engine/world/world-logic', () => ({
@@ -133,7 +135,8 @@ describe('GameScene', () => {
};
mockWorld.actors.set(1, mockPlayer);
(generator.makeTestWorld as any).mockReturnValue({
(generator.generateWorld as any).mockReturnValue({
world: mockWorld,
playerId: 1,
});
@@ -170,7 +173,8 @@ describe('GameScene', () => {
// Verify it was called with some stats
const callArgs = mockUI.showDeathScreen.mock.calls[0][0];
expect(callArgs).toHaveProperty('level');
expect(callArgs).toHaveProperty('floor');
expect(callArgs).toHaveProperty('gold');
expect(callArgs).toHaveProperty('stats');
});