Why wont my function draw multiple bricks?

So I have this simple function that should show multiple bricks, but it only shows one. Anyone knows why? I doesn’t show any errors.

function drawbricks() {

  for (var r = 0; r < 12; r++) {

    for (var c = 0; c < 6; c++) {

      var posix = r + 20;
      var posiy = c + 20;

      ctx.fillRect(posix, posiy, 50, 50);

    }
  }
}

27 thoughts on “Why wont my function draw multiple bricks?”

Leave a Comment