|
@ -1,7 +1,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
let turnCount = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mainGame(playerCount){ |
|
|
|
|
|
|
|
|
function init(playerCount){ |
|
|
//playerselect versctecken
|
|
|
//playerselect versctecken
|
|
|
document.getElementById("2Player").style.display = "none"; |
|
|
document.getElementById("2Player").style.display = "none"; |
|
|
document.getElementById("3Player").style.display = "none"; |
|
|
document.getElementById("3Player").style.display = "none"; |
|
@ -11,22 +11,17 @@ function mainGame(playerCount){ |
|
|
document.getElementById("würfelBereich").style.display = "grid"; |
|
|
document.getElementById("würfelBereich").style.display = "grid"; |
|
|
|
|
|
|
|
|
// build/show board + get board array
|
|
|
// build/show board + get board array
|
|
|
boarArr = buildBoard(); |
|
|
|
|
|
drawBoard(boarArr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boardArr = buildBoard(); |
|
|
|
|
|
drawBoard(boardArr); |
|
|
|
|
|
|
|
|
|
|
|
// make x "player" structures and add them to array
|
|
|
let playerArray = buildPlayerArray(playerCount); |
|
|
let playerArray = buildPlayerArray(playerCount); |
|
|
|
|
|
|
|
|
let rollresult = rollDice(); |
|
|
|
|
|
|
|
|
|
|
|
console.log("roll result =" + rollresult); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//miain game loop dictated by the pression of the dice roll button
|
|
|
|
|
|
document.getElementById("rollButton").addEventListener("click", function(){gameloop(boardArr,playerArray, playerCount);}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// make x "player" structures and add them to array
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Haupt game loop
|
|
|
//Haupt game loop
|
|
|
|
|
|
|
|
|
//select player
|
|
|
//select player
|
|
@ -37,16 +32,11 @@ function mainGame(playerCount){ |
|
|
// victory condition
|
|
|
// victory condition
|
|
|
//if boardArr + roll => 99 player n wins
|
|
|
//if boardArr + roll => 99 player n wins
|
|
|
//new game
|
|
|
//new game
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function gameloop (boardArr, playerArray, playerCount){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let roll = rollDice(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|