|
@ -1,12 +1,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function PlayerBuilder(id, boardArr){ |
|
|
|
|
|
|
|
|
function PlayerBuilder(){ |
|
|
|
|
|
|
|
|
this.id = id; |
|
|
|
|
|
this.location = boardArr; |
|
|
|
|
|
|
|
|
this.position = 1; |
|
|
|
|
|
|
|
|
console.log("player" + id + "built"); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -25,3 +23,13 @@ function buildPlayerArray(playerCount, boardArr){ |
|
|
return playerArray; |
|
|
return playerArray; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function movePlayer(player, roll){ |
|
|
|
|
|
|
|
|
|
|
|
player.position += roll; |
|
|
|
|
|
if(player.position >= 99){ |
|
|
|
|
|
player.position = 99; |
|
|
|
|
|
} |
|
|
|
|
|
console.log(player.position); |
|
|
|
|
|
|
|
|
|
|
|
} |