This commit is contained in:
koneko 2025-02-07 19:51:51 +01:00
parent 8b0a65a205
commit 7f27f3aef7
16 changed files with 555 additions and 285 deletions

View File

@ -2,11 +2,10 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<link href="https://fonts.googleapis.com/css?family=Aclonica" rel="stylesheet" />
<title>Bastion App</title>
<title>Bastion: The Watcher's Lament</title>
</head>
<body>
<script type="module" src="/src/main.ts"></script>

View File

@ -28,101 +28,79 @@
],
"paths": [
[
[0, 4],
[1, 4],
[2, 4],
[3, 4],
[4, 4],
[5, 4],
[6, 4],
[7, 4],
[8, 4],
[9, 4],
[10, 4],
[11, 4],
[12, 4],
[13, 4],
[14, 4],
[15, 4],
[16, 4],
[16, 5],
[16, 6],
[16, 7],
[16, 8],
[16, 9],
[16, 10],
[16, 11],
[16, 12],
[16, 13],
[16, 14],
[16, 15],
[16, 16],
[16, 17],
[16, 18],
[16, 19],
[16, 20],
[16, 21],
[16, 22],
[16, 23],
[16, 24]
],
[
[4, 0],
[4, 1],
[4, 2],
[4, 3],
[4, 4],
[4, 5],
[4, 6],
[4, 7],
[4, 8],
[4, 9],
[4, 10],
[4, 11],
[4, 12],
[0, 13],
[1, 13],
[2, 13],
[3, 13],
[4, 13],
[4, 14],
[4, 15],
[4, 16],
[4, 17],
[4, 18],
[4, 19],
[4, 20],
[4, 21],
[4, 22],
[4, 23],
[4, 24]
[5, 13],
[6, 13],
[7, 13],
[8, 13],
[9, 13],
[10, 13],
[11, 13],
[12, 13],
[13, 13],
[14, 13],
[15, 13],
[15, 12],
[15, 11],
[15, 10],
[16, 10],
[17, 10],
[18, 10],
[19, 10],
[20, 10],
[20, 9],
[20, 8],
[20, 7],
[20, 6],
[21, 6],
[22, 6],
[23, 6],
[24, 6]
],
[
[0, 12],
[1, 12],
[2, 12],
[3, 12],
[4, 12],
[5, 12],
[6, 12],
[7, 12],
[8, 12],
[9, 12],
[10, 12],
[11, 12],
[12, 12],
[13, 12],
[14, 12],
[15, 12],
[16, 12],
[16, 13],
[16, 14],
[16, 15],
[16, 16],
[16, 17],
[16, 18],
[16, 19],
[16, 20],
[16, 21],
[16, 22],
[16, 23],
[16, 24]
[14, 0],
[14, 1],
[14, 2],
[13, 2],
[12, 2],
[11, 2],
[10, 2],
[9, 2],
[8, 2],
[7, 2],
[7, 3],
[7, 4],
[7, 5],
[8, 5],
[9, 5],
[10, 5],
[11, 5],
[12, 5],
[12, 6],
[12, 7],
[12, 8],
[12, 9],
[12, 10],
[13, 10],
[14, 10],
[15, 10],
[16, 10],
[17, 10],
[18, 10],
[19, 10],
[20, 10],
[20, 9],
[20, 8],
[20, 7],
[20, 6],
[21, 6],
[22, 6],
[23, 6],
[24, 6]
]
]
},
@ -140,7 +118,7 @@
"creeps": [1, 1, 2, 1, 1]
}
],
"offeredGems": [0, 1, 2]
"offeredGems": [0, 1, 2, 0]
},
{
"waves": [

View File

@ -28,97 +28,158 @@
],
"paths": [
[
[0, 3],
[1, 3],
[2, 3],
[3, 3],
[4, 3],
[4, 4],
[4, 5],
[4, 6],
[4, 7],
[4, 8],
[4, 9],
[4, 10],
[4, 11],
[4, 12],
[5, 12],
[6, 12],
[7, 12],
[8, 12],
[8, 13],
[8, 14],
[8, 15],
[8, 16],
[8, 17],
[8, 18],
[8, 19],
[8, 20],
[8, 21],
[8, 22],
[8, 23],
[8, 24]
],
[
[0, 8],
[1, 8],
[2, 8],
[3, 8],
[4, 8],
[5, 8],
[6, 8],
[7, 8],
[8, 8],
[9, 8],
[10, 8],
[11, 8],
[12, 8],
[12, 9],
[12, 10],
[12, 11],
[12, 12],
[12, 13],
[0, 1],
[1, 1],
[2, 1],
[3, 1],
[4, 1],
[5, 1],
[6, 1],
[7, 1],
[8, 1],
[9, 1],
[10, 1],
[11, 1],
[12, 1],
[13, 1],
[14, 1],
[15, 1],
[16, 1],
[17, 1],
[17, 2],
[17, 3],
[17, 4],
[17, 5],
[17, 6],
[17, 7],
[17, 8],
[17, 9],
[17, 10],
[17, 11],
[17, 12],
[17, 13],
[17, 14],
[16, 14],
[15, 14],
[14, 14],
[13, 14],
[12, 14],
[12, 15],
[12, 16],
[12, 17],
[12, 18],
[12, 19],
[12, 20],
[12, 21],
[12, 22],
[12, 23],
[12, 24]
[11, 14],
[10, 14],
[9, 14],
[8, 14],
[7, 14],
[6, 14],
[5, 14],
[5, 13],
[5, 12],
[5, 11],
[5, 10],
[5, 9],
[6, 9],
[7, 9],
[8, 9],
[9, 9],
[10, 9],
[10, 10],
[10, 11],
[11, 11],
[12, 11],
[13, 11],
[14, 11],
[14, 10],
[14, 9],
[14, 8],
[14, 7],
[15, 7],
[16, 7],
[17, 7],
[18, 7],
[19, 7],
[20, 7],
[21, 7],
[22, 7],
[22, 8],
[23, 8],
[24, 8]
],
[
[0, 13],
[1, 13],
[0, 15],
[1, 15],
[2, 15],
[2, 14],
[2, 13],
[3, 13],
[4, 13],
[4, 14],
[4, 15],
[4, 16],
[4, 17],
[4, 18],
[4, 19],
[4, 20],
[5, 20],
[6, 20],
[7, 20],
[8, 20],
[9, 20],
[10, 20],
[11, 20],
[12, 20],
[13, 20],
[14, 20],
[15, 20],
[16, 20],
[16, 21],
[16, 22],
[16, 23],
[16, 24]
[2, 12],
[2, 11],
[2, 10],
[2, 9],
[2, 8],
[2, 7],
[2, 6],
[2, 5],
[2, 4],
[3, 4],
[4, 4],
[5, 4],
[6, 4],
[7, 4],
[8, 4],
[9, 4],
[10, 4],
[11, 4],
[12, 4],
[13, 4],
[14, 4],
[14, 5],
[14, 6],
[14, 7],
[14, 8],
[14, 9],
[14, 10],
[14, 11],
[13, 11],
[12, 11],
[11, 11],
[10, 11],
[10, 10],
[10, 9],
[9, 9],
[8, 9],
[7, 9],
[6, 9],
[5, 9],
[5, 10],
[5, 11],
[5, 12],
[5, 13],
[5, 14],
[6, 14],
[7, 14],
[8, 14],
[9, 14],
[10, 14],
[11, 14],
[12, 14],
[13, 14],
[14, 14],
[15, 14],
[16, 14],
[17, 14],
[17, 13],
[17, 12],
[17, 11],
[17, 10],
[17, 9],
[17, 8],
[17, 7],
[18, 7],
[19, 7],
[20, 7],
[21, 7],
[22, 7],
[22, 8],
[23, 8],
[24, 8]
]
]
},

View File

@ -28,101 +28,79 @@
],
"paths": [
[
[8, 0],
[8, 1],
[8, 2],
[8, 3],
[8, 4],
[5, 0],
[5, 1],
[5, 2],
[4, 2],
[3, 2],
[2, 2],
[2, 3],
[2, 4],
[2, 5],
[3, 5],
[4, 5],
[5, 5],
[6, 5],
[7, 5],
[8, 5],
[8, 6],
[8, 7],
[8, 8],
[7, 8],
[6, 8],
[5, 8],
[4, 8],
[4, 9],
[4, 10],
[4, 11],
[4, 12],
[4, 13],
[4, 14],
[9, 5],
[10, 5],
[11, 5],
[12, 5],
[13, 5],
[13, 4],
[13, 3],
[13, 2],
[14, 2],
[15, 2],
[16, 2],
[17, 2],
[18, 2],
[19, 2],
[20, 2],
[21, 2],
[21, 3],
[21, 4],
[21, 5],
[22, 5],
[23, 5],
[24, 5]
],
[
[0, 9],
[1, 9],
[2, 9],
[2, 10],
[2, 11],
[2, 12],
[2, 13],
[2, 14],
[2, 15],
[3, 15],
[4, 15],
[4, 16],
[4, 17],
[4, 18],
[4, 19],
[4, 20],
[4, 21],
[4, 22],
[4, 23],
[4, 24]
],
[
[8, 0],
[8, 1],
[8, 2],
[8, 3],
[8, 4],
[8, 5],
[8, 6],
[8, 7],
[8, 8],
[9, 8],
[10, 8],
[11, 8],
[12, 8],
[12, 9],
[12, 10],
[12, 11],
[12, 12],
[5, 15],
[6, 15],
[7, 15],
[8, 15],
[9, 15],
[10, 15],
[11, 15],
[11, 14],
[11, 13],
[12, 13],
[12, 14],
[12, 15],
[12, 16],
[12, 17],
[12, 18],
[12, 19],
[12, 20],
[12, 21],
[12, 22],
[12, 23],
[12, 24]
],
[
[0, 8],
[1, 8],
[2, 8],
[3, 8],
[4, 8],
[5, 8],
[6, 8],
[7, 8],
[8, 8],
[9, 8],
[10, 8],
[11, 8],
[12, 8],
[13, 8],
[14, 8],
[15, 8],
[16, 8],
[16, 9],
[16, 10],
[16, 11],
[16, 12],
[13, 13],
[14, 13],
[15, 13],
[16, 13],
[16, 14],
[16, 15],
[16, 16],
[16, 17],
[16, 18],
[16, 19],
[16, 20],
[16, 21],
[16, 22],
[16, 23],
[16, 24]
[17, 13],
[17, 14],
[18, 14],
[19, 14],
[20, 14],
[21, 14],
[22, 14],
[23, 14],
[24, 14]
]
]
},

View File

@ -0,0 +1,223 @@
{
"name": "Final Stretch",
"description": "The final map, the longest map, the 7th map.",
"mapImage": {
"url": "/assets/maps/07_final_stretch.png"
},
"gameMap": {
"rows": 17,
"columns": 25,
"cells": [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
],
"paths": [
[
[2, 0],
[2, 1],
[2, 2],
[2, 3],
[2, 4],
[2, 5],
[2, 6],
[2, 7],
[2, 8],
[2, 9],
[2, 10],
[2, 11],
[2, 12],
[2, 13],
[2, 14],
[3, 14],
[4, 14],
[5, 14],
[6, 14],
[6, 13],
[6, 12],
[6, 11],
[6, 10],
[6, 9],
[6, 8],
[6, 7],
[6, 6],
[6, 5],
[6, 4],
[6, 3],
[6, 2],
[7, 2],
[8, 2],
[9, 2],
[10, 2],
[10, 3],
[10, 4],
[10, 5],
[10, 6],
[10, 7],
[10, 8],
[10, 9],
[10, 10],
[10, 11],
[10, 12],
[10, 13],
[10, 14],
[11, 14],
[12, 14],
[13, 14],
[14, 14],
[14, 13],
[14, 12],
[14, 11],
[14, 10],
[14, 9],
[14, 8],
[14, 7],
[14, 6],
[14, 5],
[14, 4],
[14, 3],
[14, 2],
[15, 2],
[16, 2],
[17, 2],
[18, 2],
[18, 3],
[18, 4],
[18, 5],
[18, 6],
[18, 7],
[18, 8],
[18, 9],
[18, 10],
[18, 11],
[18, 12],
[18, 13],
[18, 14],
[19, 14],
[20, 14],
[21, 14],
[22, 14],
[22, 13],
[22, 12],
[22, 11],
[22, 10],
[22, 9],
[22, 8],
[22, 7],
[22, 6],
[22, 5],
[22, 4],
[22, 3],
[22, 2],
[22, 1],
[22, 0]
]
]
},
"rounds": [
{
"waves": [
{
"firstCreepSpawnTick": 500,
"spawnIntervalTicks": 700,
"creeps": [0, 1, 0, 1, 0, 1, 0]
},
{
"firstCreepSpawnTick": 5000,
"spawnIntervalTicks": 500,
"creeps": [1, 1, 2, 1, 1, 2, 1]
}
],
"offeredGems": [0, 1, 2, 3]
},
{
"waves": [
{
"firstCreepSpawnTick": 500,
"spawnIntervalTicks": 600,
"creeps": [2, 1, 2, 1, 2, 1, 2, 1]
},
{
"firstCreepSpawnTick": 6000,
"spawnIntervalTicks": 400,
"creeps": [2, 2, 1, 1, 2, 2, 1, 1]
}
],
"offeredGems": [0, 1, 2, 3]
},
{
"waves": [
{
"firstCreepSpawnTick": 500,
"spawnIntervalTicks": 500,
"creeps": [2, 2, 1, 1, 2, 2, 1, 1, 2]
},
{
"firstCreepSpawnTick": 6000,
"spawnIntervalTicks": 300,
"creeps": [2, 2, 2, 1, 1, 1, 2, 2, 2]
}
],
"offeredGems": [0, 1, 2, 3]
},
{
"waves": [
{
"firstCreepSpawnTick": 500,
"spawnIntervalTicks": 400,
"creeps": [2, 2, 2, 1, 1, 1, 2, 2, 2, 1]
},
{
"firstCreepSpawnTick": 7000,
"spawnIntervalTicks": 250,
"creeps": [2, 2, 2, 2, 1, 1, 1, 1, 2, 2]
}
],
"offeredGems": [0, 1, 2, 3]
},
{
"waves": [
{
"firstCreepSpawnTick": 500,
"spawnIntervalTicks": 300,
"creeps": [2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2]
},
{
"firstCreepSpawnTick": 7000,
"spawnIntervalTicks": 200,
"creeps": [2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2]
}
],
"offeredGems": [0, 1, 2, 3]
},
{
"waves": [
{
"firstCreepSpawnTick": 500,
"spawnIntervalTicks": 250,
"creeps": [2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2]
},
{
"firstCreepSpawnTick": 8000,
"spawnIntervalTicks": 150,
"creeps": [2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]
}
],
"offeredGems": [0, 1, 2, 3]
}
]
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -158,6 +158,7 @@ export default class GameAssets {
await this.LoadMission('./assets/missions/04_crossroads.json');
await this.LoadMission('./assets/missions/05_the_maze.json');
await this.LoadMission('./assets/missions/06_multiple_fronts.json');
await this.LoadMission('./assets/missions/07_final_stretch.json');
}
private static async LoadTowers() {

View File

@ -22,6 +22,7 @@ export class Engine {
public static NotificationManager: NotificationManager;
public static GameScene: GameScene;
public static latestCommit: string;
public static latestGemId = 0;
public static GridCellSize: number = 64;
public static GridColumns: number = 25;

View File

@ -1,8 +1,7 @@
import * as PIXI from 'pixi.js';
import { GemType, GemDefinition, GenericGemImprovement } from '../Definitions';
import GameAssets from '../Assets';
let latestGemId = 0;
import { Engine } from '../Bastion';
export default class Gem {
public texture: PIXI.Texture;
@ -14,8 +13,8 @@ export default class Gem {
this.texture = this.definition.textures[0];
if (!doNotIncrement) {
this.id = latestGemId + 1;
latestGemId++;
this.id = Engine.latestGemId + 1;
Engine.latestGemId++;
} else this.id = '';
}
public currentGemImprovement() {

View File

@ -6,6 +6,8 @@ import { Engine } from '../Bastion';
import Creep from './Creep';
import { CreepEvents, TowerEvents, GridEvents } from '../Events';
let genPath = [];
export class Cell extends GameObject {
public type: TerrainType;
public row: number;
@ -55,6 +57,7 @@ export class Cell extends GameObject {
Engine.GameScene.events.emit(GridEvents.CellMouseLeave, this);
Engine.Grid.rangePreview.clear();
});
Engine.GameScene.events.on(TowerEvents.TowerPlacedEvent, (_, row, col) => {
if (row == this.row && col == this.column) {
this.hasTowerPlaced = true;
@ -68,11 +71,13 @@ export class Cell extends GameObject {
});
// Disable this if you want to add new maps.
// if(true) return;
if (true) return;
const text = new PIXI.Text({
text: `${this.column}|${this.row}`,
style: new PIXI.TextStyle({
fill: 0xffffff,
fontSize: 16,
stroke: {
color: 0x000000,
width: 2,
@ -87,6 +92,18 @@ export class Cell extends GameObject {
text.style.fill = 'pink';
text.style.fontWeight = 'bold';
}
this.clickDetector.on('pointerup', () => {
const cellIndex = genPath.findIndex(([col, row]) => col === this.column && row === this.row);
if (cellIndex !== -1) {
text.style.fill = 0xffffff;
genPath.splice(cellIndex, 1);
} else {
text.style.fill = 0xff0000;
genPath.push([this.column, this.row]);
}
console.log('updated gen path');
console.log(JSON.stringify(genPath));
});
}
public showRangePreview(invalid, range) {
let color = 0xffffff;

View File

@ -3,7 +3,7 @@ import GameObject from '../GameObject';
import * as PIXI from 'pixi.js';
import { FadeInOut } from './AnimationManager';
export type NotificationType = 'info' | 'warn' | 'danger' | 'reward' | 'gemaward';
export type NotificationType = 'info' | 'warn' | 'danger' | 'reward' | 'gemaward' | 'green';
class Notification {
public textObj: PIXI.Text;
@ -22,6 +22,8 @@ class Notification {
fill = 0xd65afc;
} else if (type == 'gemaward') {
fill = 0xffffff;
} else if (type == 'green') {
fill = 0x00ff00;
}
this.ticksToFadeAway = ticksToFadeAway;
this.textObj = new PIXI.Text({

View File

@ -17,31 +17,38 @@ export default class WaveManager extends GameObject {
private paths: PathDefinition[];
private ticks: number = 0;
private started: boolean = false;
public finished: boolean = false;
private internalCreepId: number = 0;
private pathsIndex: number;
public finished: boolean = false;
constructor(rounds: MissionRoundDefinition[], paths: PathDefinition[]) {
super();
Engine.WaveManager = this;
this.rounds = rounds;
this.paths = paths;
this.pathsIndex = 0;
}
public start(roundIndex) {
this.started = true;
this.ticks = 0;
this.creeps = [];
this.finished = false;
if (this.pathsIndex + 1 == this.paths.length) {
this.pathsIndex = 0;
} else {
this.pathsIndex++;
}
let tickToSpawnAt = 0;
this.rounds[roundIndex].waves.forEach((wave) => {
tickToSpawnAt += wave.firstCreepSpawnTick;
wave.creeps.forEach((creep) => {
const creepObj = new Creep(creep, this.paths[0], this.internalCreepId);
const creepObj = new Creep(creep, this.paths[this.pathsIndex], this.internalCreepId);
this.internalCreepId++;
const creepInstance = {
creep: creepObj,
tickToSpawnAt,
spawned: false,
};
console.log('CREAWTASEDASD');
tickToSpawnAt += wave.spawnIntervalTicks;
this.creeps.push(creepInstance);
});
@ -58,10 +65,8 @@ export default class WaveManager extends GameObject {
if (!creep.spawned && creep.tickToSpawnAt <= this.ticks) {
creep.spawned = true;
this.events.emit(WaveManagerEvents.CreepSpawned, creep.creep);
console.log('Wave manager creep spawned, ', creep, this.ticks);
if (!this.finished && this.creeps.every((creep) => creep.spawned)) {
this.finished = true;
console.log('wave manager finished');
this.events.emit(WaveManagerEvents.Finished);
}
} else if (creep.spawned) {

View File

@ -6,8 +6,8 @@ import { GameScene } from './scenes/Game';
import { AnimationManager } from './classes/game/AnimationManager';
import NotificationManager from './classes/game/NotificationManager';
import GameUIConstants from './classes/GameUIConstants';
import MessageBox from './classes/gui/MessageBox';
import KeyboardManager from './classes/game/KeyboardManager';
import { GemType } from './classes/Definitions';
(async () => {
const app = new PIXI.Application();

View File

@ -59,6 +59,7 @@ export class GameScene extends Scene {
});
}
public init() {
Engine.latestGemId = 0;
new Grid(this.mission.gameMap, this.missionIndex);
new TowerManager();
new WaveManager(this.mission.rounds, this.mission.gameMap.paths);
@ -257,10 +258,14 @@ export class GameScene extends Scene {
this.ReturnToMain();
} else if (result === HighScoreDialogButtons.NextMission) {
this.destroy();
Engine.GameMaster.changeScene(new MissionPickerScene());
Engine.GameMaster.changeScene(new GameScene(GameAssets.Missions[this.missionIndex + 1].name));
Engine.NotificationManager.Notify('Loading next mission. Good luck.', 'green');
} else if (result === HighScoreDialogButtons.Retry) {
this.destroy();
Engine.GameMaster.changeScene(new MissionPickerScene());
Engine.GameMaster.changeScene(new GameScene(this.mission.name));
Engine.NotificationManager.Notify('Retrying mission.', 'green');
}
}

View File

@ -12,6 +12,7 @@ export default class Scene {
}
public destroy() {
this.stage.destroy();
this._events.removeAllListeners();
this.gui.forEach((element) => {
element.destroy();
});