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

Function drawBricks

assets/js/breakout.js:112–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110ctx.closePath();
111}
112function drawBricks() {
113for(var c=0; c<brickColumnCount; c++) {
114 for(var r=0; r<brickRowCount; r++) {
115 if(bricks[c][r].status == 1) {
116 var brickX = (r*(brickWidth+brickPadding))+brickOffsetLeft;
117 var brickY = (c*(brickHeight+brickPadding))+brickOffsetTop;
118 bricks[c][r].x = brickX;
119 bricks[c][r].y = brickY;
120 ctx.beginPath();
121 ctx.rect(brickX, brickY, brickWidth, brickHeight);
122 ctx.fillStyle = grd;
123 ctx.fill();
124 ctx.closePath();
125 }
126 }
127}
128}
129function drawScore() {
130ctx.font = "16px Arial";
131ctx.fillStyle = "white";

Callers 1

drawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected