|
|
@ -35,11 +35,45 @@ function movePlayer(player, roll){ |
|
|
|
//TODO gewinn aufrufen.
|
|
|
|
} |
|
|
|
//TODO Schlange oder Leiter fehlschalg.
|
|
|
|
} |
|
|
|
//Draw Spieler bei Spiele init
|
|
|
|
function playerInit(playerArray){ |
|
|
|
for(let i = 0; i < playerArray.length; i++){ |
|
|
|
var Token = document.createElement("div") |
|
|
|
if(i == 0){ |
|
|
|
let position = playerArray[i].position |
|
|
|
var boardPostition = boardLocation(position); |
|
|
|
Token.classList.add("p1"); |
|
|
|
Token.id = "p1"; |
|
|
|
document.getElementById(boardPostition).appendChild(Token) |
|
|
|
} |
|
|
|
else if(i == 1){ |
|
|
|
let position = playerArray[i].position |
|
|
|
var boardPostition = boardLocation(position); |
|
|
|
Token.classList.add("p2"); |
|
|
|
Token.id = "p2"; |
|
|
|
document.getElementById(boardPostition).appendChild(Token) |
|
|
|
} |
|
|
|
else if(i == 2){ |
|
|
|
let position = playerArray[i].position |
|
|
|
var boardPostition = boardLocation(position); |
|
|
|
Token.classList.add("p3"); |
|
|
|
Token.id = "p3"; |
|
|
|
document.getElementById(boardPostition).appendChild(Token) |
|
|
|
} |
|
|
|
else if(i == 3){ |
|
|
|
let position = playerArray[i].position |
|
|
|
var boardPostition = boardLocation(position); |
|
|
|
Token.classList.add("p4"); |
|
|
|
Token.id = "p4"; |
|
|
|
document.getElementById(boardPostition).appendChild(Token) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//TODO Stele Zeichnen
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function drawNew(playerArray, turnCount){ |
|
|
|
// wo muss es hin
|
|
|
|