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

Function drawEndFlag

assets/js/maze.js:264–290  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

262 }
263
264 function drawEndFlag() {
265 var coord = Maze.endCoord();
266 var gridSize = 4;
267 var fraction = cellSize / gridSize - 2;
268 var colorSwap = true;
269 for (let y = 0; y < gridSize; y++) {
270 if (gridSize % 2 == 0) {
271 colorSwap = !colorSwap;
272 }
273 for (let x = 0; x < gridSize; x++) {
274 ctx.beginPath();
275 ctx.rect(
276 coord.x * cellSize + x * fraction + 4.5,
277 coord.y * cellSize + y * fraction + 4.5,
278 fraction,
279 fraction
280 );
281 if (colorSwap) {
282 ctx.fillStyle = "rgba(0, 0, 0, 0.8)";
283 } else {
284 ctx.fillStyle = "rgba(255, 255, 255, 0.8)";
285 }
286 ctx.fill();
287 colorSwap = !colorSwap;
288 }
289 }
290 }
291
292 function drawEndSprite() {
293 var offsetLeft = cellSize / 50;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected