(matrix, x, y)
| 71 | player.color = colors[rand+1]; |
| 72 | |
| 73 | function drawMatrix(matrix, x, y) { |
| 74 | for (let i = 0; i < matrix.length; i++) { |
| 75 | for (let j = 0; j < matrix[i].length; j++) { |
| 76 | if (matrix[i][j]) |
| 77 | ctx.fillRect(x + j, y + i, 1, 1); |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | function rotateMatrix(matrix, dir) { |
| 83 | let newMatrix = []; |