MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / drawMatrix

Function drawMatrix

assets/js/TetrisGame.js:73–80  ·  view source on GitHub ↗
(matrix, x, y)

Source from the content-addressed store, hash-verified

71player.color = colors[rand+1];
72
73function 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
82function rotateMatrix(matrix, dir) {
83 let newMatrix = [];

Callers 1

updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected