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

Function drawCell

assets/js/maze.js:226–254  ·  view source on GitHub ↗
(xCord, yCord, cell)

Source from the content-addressed store, hash-verified

224 };
225
226 function drawCell(xCord, yCord, cell) {
227 var x = xCord * cellSize;
228 var y = yCord * cellSize;
229
230 if (cell.n == false) {
231 ctx.beginPath();
232 ctx.moveTo(x, y);
233 ctx.lineTo(x + cellSize, y);
234 ctx.stroke();
235 }
236 if (cell.s === false) {
237 ctx.beginPath();
238 ctx.moveTo(x, y + cellSize);
239 ctx.lineTo(x + cellSize, y + cellSize);
240 ctx.stroke();
241 }
242 if (cell.e === false) {
243 ctx.beginPath();
244 ctx.moveTo(x + cellSize, y);
245 ctx.lineTo(x + cellSize, y + cellSize);
246 ctx.stroke();
247 }
248 if (cell.w === false) {
249 ctx.beginPath();
250 ctx.moveTo(x, y);
251 ctx.lineTo(x, y + cellSize);
252 ctx.stroke();
253 }
254 }
255
256 function drawMap() {
257 for (x = 0; x < map.length; x++) {

Callers 1

drawMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected