create basic win popup

This commit is contained in:
evanpelle
2024-09-16 11:51:24 -07:00
parent 2f626bcc39
commit 534d97abb3
15 changed files with 287 additions and 27 deletions
+3 -3
View File
@@ -9,6 +9,7 @@ import {ClientID, ClientIntentMessageSchema, ClientJoinMessageSchema, ClientLeav
import {TerrainMap} from "../core/TerrainMapLoader";
import {and, bfs, dist, manhattanDist} from "../core/Util";
import {TerrainRenderer} from "./graphics/TerrainRenderer";
import {WinCheckExecution} from "../core/execution/WinCheckExecution";
@@ -16,7 +17,7 @@ export function createClientGame(name: string, clientID: ClientID, playerID: Pla
let eventBus = new EventBus()
let game = createGame(terrainMap, eventBus, config)
let terrainRenderer = new TerrainRenderer(game)
let gameRenderer = new GameRenderer(game, clientID, terrainRenderer)
let gameRenderer = new GameRenderer(eventBus, game, clientID, terrainRenderer)
return new ClientGame(
name,
@@ -40,7 +41,6 @@ export class ClientGame {
private currTurn = 0
private intervalID: NodeJS.Timeout
private isProcessingTurn = false
@@ -131,8 +131,8 @@ export class ClientGame {
this.renderer.initialize()
this.input.initialize()
this.gs.addExecution(...this.executor.spawnBots(this.gs.config().numBots()))
console.log('!!! number fake humans ')
this.gs.addExecution(...this.executor.fakeHumanExecutions(this.gs.config().numFakeHumans(this.gameID)))
this.gs.addExecution(new WinCheckExecution(this.eventBus))
this.intervalID = setInterval(() => this.tick(), 10);
}