|
@ -29,13 +29,18 @@ function buildPlayerArray(playerCount, boardArr){ |
|
|
|
|
|
|
|
|
function movePlayer(player, roll){ |
|
|
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
|
|
|
//wandelt Zellennummer in html-Element um
|
|
|
function boardLocation(cellNumber){ |
|
|
function boardLocation(cellNumber){ |
|
|