|
@ -30,8 +30,8 @@ function buildPlayerArray(playerCount, boardArr){ |
|
|
function movePlayer(player, roll){ |
|
|
function movePlayer(player, roll){ |
|
|
|
|
|
|
|
|
player.newPosition = player.position + roll; |
|
|
player.newPosition = player.position + roll; |
|
|
if(player.newPosition >= 99){ |
|
|
|
|
|
player.newPosition = 99; |
|
|
|
|
|
|
|
|
if(player.newPosition >= 100){ |
|
|
|
|
|
player.newPosition = 100; |
|
|
//TODO gewinn aufrufen.
|
|
|
//TODO gewinn aufrufen.
|
|
|
} |
|
|
} |
|
|
//TODO Schlange oder Leiter fehlschalg.
|
|
|
//TODO Schlange oder Leiter fehlschalg.
|
|
@ -75,6 +75,7 @@ function movePlayer(player, roll){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Stele Zeichnen
|
|
|
function drawNew(playerArray, turnCount){ |
|
|
function drawNew(playerArray, turnCount){ |
|
|
// wo muss es hin
|
|
|
// wo muss es hin
|
|
|
var player = playerArray[turnCount-1]; |
|
|
var player = playerArray[turnCount-1]; |
|
@ -86,15 +87,19 @@ function movePlayer(player, roll){ |
|
|
//besonderer Spiler Token auswahlen
|
|
|
//besonderer Spiler Token auswahlen
|
|
|
if((turnCount-1) == 0){ |
|
|
if((turnCount-1) == 0){ |
|
|
Token.classList.add("p1"); |
|
|
Token.classList.add("p1"); |
|
|
|
|
|
Token.id = "p1"; |
|
|
} |
|
|
} |
|
|
else if((turnCount-1) == 1){ |
|
|
else if((turnCount-1) == 1){ |
|
|
Token.classList.add("p2"); |
|
|
Token.classList.add("p2"); |
|
|
|
|
|
Token.id = "p2"; |
|
|
} |
|
|
} |
|
|
else if((turnCount-1) == 2){ |
|
|
else if((turnCount-1) == 2){ |
|
|
Token.classList.add("p3"); |
|
|
Token.classList.add("p3"); |
|
|
|
|
|
Token.id = "p3"; |
|
|
} |
|
|
} |
|
|
else if((turnCount-1) == 3){ |
|
|
else if((turnCount-1) == 3){ |
|
|
Token.classList.add("p4"); |
|
|
Token.classList.add("p4"); |
|
|
|
|
|
Token.id = "p4"; |
|
|
} |
|
|
} |
|
|
//Zeichnen
|
|
|
//Zeichnen
|
|
|
document.getElementById(boardPostition).appendChild(Token); |
|
|
document.getElementById(boardPostition).appendChild(Token); |
|
@ -102,7 +107,30 @@ function movePlayer(player, roll){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//TODO alte Stelle löschen
|
|
|
//TODO alte Stelle löschen
|
|
|
|
|
|
function eraseOLd(playerArray, turnCount){ |
|
|
|
|
|
|
|
|
|
|
|
var player = playerArray[turnCount-1]; |
|
|
|
|
|
var position = player.position; |
|
|
|
|
|
let toErase; |
|
|
|
|
|
//wo es ist auf dem spielbrett
|
|
|
|
|
|
var boardPostition = boardLocation(position); |
|
|
|
|
|
// was muss gelöscht werden
|
|
|
|
|
|
|
|
|
|
|
|
//besonderer Spiler Token auswahlen
|
|
|
|
|
|
if((turnCount-1) == 0){ |
|
|
|
|
|
document.getElementById("p1").remove(); |
|
|
|
|
|
} |
|
|
|
|
|
else if((turnCount-1) == 1){ |
|
|
|
|
|
document.getElementById("p2").remove(); |
|
|
|
|
|
} |
|
|
|
|
|
else if((turnCount-1) == 2){ |
|
|
|
|
|
document.getElementById("p3").remove(); |
|
|
|
|
|
} |
|
|
|
|
|
else if((turnCount-1) == 3){ |
|
|
|
|
|
document.getElementById("p4").remove(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
//TODO zeichen für jede Spieler
|
|
|
//TODO zeichen für jede Spieler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|