MultiplayerMinesweeper/client/scripts/interface/scene.js
2023-04-03 15:34:15 -04:00

34 lines
793 B
JavaScript

import {ID} from "../util.js"
import * as createMenu from "./mainmenu/create.js"
import * as joinMenu from "./mainmenu/join.js"
const menu = ID('menu')
const game = ID('game')
const joinType = ID("joinType")
const joinGameMenu = ID("joinGame")
const createGameMenu = ID("createGame")
export function changeScene(scene) {
console.log(`Changing scene to ${scene}`)
switch (scene) {
case "game":
menu.style = "display: none;"
game.style = ""
break;
case "mainmenu":
menu.style = ""
game.style = "display: none;"
break;
case "newgame":
joinType.style.display = "none";
createGameMenu.style.display = "";
createMenu.init();
break;
case "joingame":
joinType.style.display = "none";
joinGameMenu.style.display = "";
joinMenu.init();
break;
}
};