diff --git a/schlangen_und_leitern/js/Bridge.js b/schlangen_und_leitern/js/Bridge.js index 3125ccf..52ecb5e 100644 --- a/schlangen_und_leitern/js/Bridge.js +++ b/schlangen_und_leitern/js/Bridge.js @@ -10,8 +10,17 @@ function mainGame(playerCount){ // Wufelbereich zeigen. document.getElementById("würfelBereich").style.display = "grid"; + // build/show board + get board array + boarArr = buildBoard(); + drawBoard(boarArr); + let playerArray = buildPlayerArray(playerCount); + + let rollresult = rollDice(); + + console.log("roll result =" + rollresult); + diff --git a/schlangen_und_leitern/js/playerHandling.js b/schlangen_und_leitern/js/playerHandling.js new file mode 100644 index 0000000..610152b --- /dev/null +++ b/schlangen_und_leitern/js/playerHandling.js @@ -0,0 +1,27 @@ + + + +function PlayerBuilder(id, boardArr){ + + this.id = id; + this.location = boardArr; + + console.log("player" + id + "built"); +} + + + + +function buildPlayerArray(playerCount, boardArr){ + + let playerArray = []; + + for(let i = 1; i <= playerCount; i++){ + let player = new PlayerBuilder(i); + playerArray.push(player) + console.log("player added to array!") + } + + return playerArray; + +} \ No newline at end of file