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

Function clearBlocks

assets/js/TetrisGame.js:124–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122}
123
124function clearBlocks() {
125 for (let i = 1; i < arena.length-2; i++) {
126 let clear = 1;
127
128 for (let j = 1; j < arena[i].length-1; j++) {
129 if (!arena[i][j])
130 clear = 0;
131 }
132
133 if (clear) {
134 let r = new Array(tWidth).fill(0);
135 r.push(1);
136 r.unshift(1);
137
138 arena.splice(i, 1);
139 arena.splice(1, 0, r);
140 }
141 }
142}
143
144function drawArena() {
145 for (let i = 1; i < arena.length-2; i++) {

Callers 1

updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected