diff --git a/schlangen_und_leitern/js/playerHandling.js b/schlangen_und_leitern/js/playerHandling.js index 4a51084..f8b40b1 100644 --- a/schlangen_und_leitern/js/playerHandling.js +++ b/schlangen_und_leitern/js/playerHandling.js @@ -29,13 +29,18 @@ function buildPlayerArray(playerCount, boardArr){ function movePlayer(player, roll){ -player.position += roll; -if(player.position >= 99){ - player.position = 99; -} -console.log(player.position); + player.newPosition = player.position + roll; + if(player.newPosition >= 99){ + player.newPosition = 99; + //TODO gewinn aufrufen. + } + //TODO Schlange oder Leiter fehlschalg. + + + + console.log("new position" + player.newPosition); + } -} //wandelt Zellennummer in html-Element um function boardLocation(cellNumber){