Skip to content

Commit

Permalink
[feat] Add lobby screen for singleplayer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jan 29, 2025
1 parent f8e356a commit 9e5b2b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/scenarios/netGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function runScenario(game: Game) {
}
const gameInstance = game.netGameInstance;
const parent = game.viewport;
const world = game.world as NetGameWorld;
const world = game.world;
const { worldWidth } = game.viewport;
const wormInstances = new Map<string, Worm>();

Expand Down Expand Up @@ -323,10 +323,12 @@ export default async function runScenario(game: Game) {
.subscribe(([roundState, worm]) => {
if (
worm?.team.playerUserId === gameInstance.myUserId &&
roundState === RoundState.Preround
roundState === RoundState.Preround &&
world instanceof NetGameWorld
) {
world.setBroadcasting(true);
} else if (roundState === RoundState.Finished) {
} else if (roundState === RoundState.Finished &&
world instanceof NetGameWorld) {
world.setBroadcasting(false);
}
log.info("Round state sub fired for", roundState, worm);
Expand Down

0 comments on commit 9e5b2b2

Please sign in to comment.