2022-07-20 03:50:48 +00:00
|
|
|
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")
|
|
|
|
|
2022-06-20 00:18:47 +00:00
|
|
|
|
2022-06-20 00:38:09 +00:00
|
|
|
export function changeScene(scene) {
|
2022-07-20 03:50:48 +00:00
|
|
|
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;
|
2022-06-20 00:38:09 +00:00
|
|
|
}
|
2022-06-20 00:18:47 +00:00
|
|
|
};
|