function startGame() {
    if (document.getElementById("name").value != "" && document.getElementById("characterClass").value != "" &&
        document.getElementById("characterRace").value != "") {
        document.getElementById("formError").style.visibility = "hidden";
        gameStarted = true;
        closeWindow();
        let player = createPlayer(window['player' + 1]);
        document.getElementById("chosenName").innerHTML = "Name: " + player.name;
        document.getElementById("chosenTypes").innerHTML = "Race & Class: " + player.race + " " + player.class;
        document.getElementById("chosenVIT").innerHTML = "VIT: " + player.vit;
        document.getElementById("chosenSTR").innerHTML = "STR: " + player.str;
        document.getElementById("chosenWIS").innerHTML = "WIS: " + player.wis;
        document.getElementById("chosenDEX").innerHTML = "DEX: " + player.dex;
        document.getElementById("chosenSPE").innerHTML = "SPE: " + player.spe;
        document.getElementById("chosenHP").innerHTML = "HP: " + player.hpLeft + "/" + player.hp;
        document.getElementById("chosenMP").innerHTML = "MP: " + player.mpLeft + "/" + player.mp;


    }
    else {
        document.getElementById("formError").style.visibility = "visible";
    }
}
/**
 * Collects the input from pop-up window and starts the game for the player.
 * Shows error if player has missing information.
 */
Collects the input from pop-up window and starts the game for the player.
Shows error if player has missing information.
Collects the input from pop - up window and starts the game for the player . Shows error if player has missing information .
function startGame() {
    if (document.getElementById("name").value != "" && document.getElementById("characterClass").value != "" &&
        document.getElementById("characterRace").value != "") {
        document.getElementById("formError").style.visibility = "hidden";
        gameStarted = true;
        closeWindow();
        let player = createPlayer(window['player' + 1]);
        document.getElementById("chosenName").innerHTML = "Name: " + player.name;
        document.getElementById("chosenTypes").innerHTML = "Race & Class: " + player.race + " " + player.class;
        document.getElementById("chosenVIT").innerHTML = "VIT: " + player.vit;
        document.getElementById("chosenSTR").innerHTML = "STR: " + player.str;
        document.getElementById("chosenWIS").innerHTML = "WIS: " + player.wis;
        document.getElementById("chosenDEX").innerHTML = "DEX: " + player.dex;
        document.getElementById("chosenSPE").innerHTML = "SPE: " + player.spe;
        document.getElementById("chosenHP").innerHTML = "HP: " + player.hpLeft + "/" + player.hp;
        document.getElementById("chosenMP").innerHTML = "MP: " + player.mpLeft + "/" + player.mp;
    }
    else {
        document.getElementById("formError").style.visibility = "visible";
    }
}
function startGame ( ) { if ( document . getElementById ( "name" ) . value != "" && document . getElementById ( "characterClass" ) . value != "" && document . getElementById ( "characterRace" ) . value != "" ) { document . getElementById ( "formError" ) . style . visibility = "hidden" ; gameStarted = true ; closeWindow ( ) ; let player = createPlayer ( window [ 'player' + 1 ] ) ; document . getElementById ( "chosenName" ) . innerHTML = "Name: " + player . name ; document . getElementById ( "chosenTypes" ) . innerHTML = "Race & Class: " + player . race + " " + player . class ; document . getElementById ( "chosenVIT" ) . innerHTML = "VIT: " + player . vit ; document . getElementById ( "chosenSTR" ) . innerHTML = "STR: " + player . str ; document . getElementById ( "chosenWIS" ) . innerHTML = "WIS: " + player . wis ; document . getElementById ( "chosenDEX" ) . innerHTML = "DEX: " + player . dex ; document . getElementById ( "chosenSPE" ) . innerHTML = "SPE: " + player . spe ; document . getElementById ( "chosenHP" ) . innerHTML = "HP: " + player . hpLeft + "/" + player . hp ; document . getElementById ( "chosenMP" ) . innerHTML = "MP: " + player . mpLeft + "/" + player . mp ; } else { document . getElementById ( "formError" ) . style . visibility = "visible" ; } }
Collects the input from pop-up window and starts the game for the player.
Collects the input from pop - up window and starts the game for the player .