|
|
@ -3,9 +3,9 @@ function buildBoard(objectArr,canvasPointArr){ |
|
|
|
// build board array
|
|
|
|
let boardArr = buildBoardArray() |
|
|
|
//leiter Objekte(anfang , ende)
|
|
|
|
let leitern = [[7, 33],[24, 44],[31, 55],[60, 77]]; |
|
|
|
let leitern = []; |
|
|
|
//schlange Objekte (anfang , ende)
|
|
|
|
let schlangen = [[99, 56], [86, 64],[60, 28],[18,1]]; |
|
|
|
let schlangen = []; |
|
|
|
dynamicObjects(leitern, schlangen) |
|
|
|
// draw board on screen using board array
|
|
|
|
drawBoard(boardArr); |
|
|
@ -82,7 +82,7 @@ function buildBoardArray(){ |
|
|
|
end = 1 |
|
|
|
} |
|
|
|
//add these as an [] to corisponding array
|
|
|
|
snakeArr[i] = [start,end] |
|
|
|
snakeArr.push([start,end]) |
|
|
|
} |
|
|
|
for (let i = 0; i < ladderCount; i++){ |
|
|
|
//pick random number between 1 and 90
|
|
|
@ -101,7 +101,7 @@ function buildBoardArray(){ |
|
|
|
end = 99 |
|
|
|
} |
|
|
|
//add these as an [] to corisponding array
|
|
|
|
ladderArr[i] = [start,end] |
|
|
|
ladderArr.push([start,end]) |
|
|
|
} |
|
|
|
console.log(snakeArr) |
|
|
|
console.log(ladderArr) |
|
|
@ -372,5 +372,6 @@ function hideStartMenu(){ |
|
|
|
module.exports = { |
|
|
|
buildBoardArray, |
|
|
|
generateBoardObjects, |
|
|
|
boardObject |
|
|
|
boardObject, |
|
|
|
dynamicObjects |
|
|
|
} |