Reflect

reflect() #

Horizontal reflection of the quadrille cells.

Example #

(mouse click or press any key to reflect the quadrille)

code
let quadrille;

function setup() {
  createCanvas(4 * Quadrille.cellLength, 4 * Quadrille.cellLength);
  quadrille = createQuadrille(4, 4, 3, '🚀');
  quadrille.rand(4, '🐒');
}

function draw() {
  background('orange');
  drawQuadrille(quadrille);
}

function mouseClicked() {
  quadrille.reflect();  
}

function keyPressed() {
  quadrille.reflect();
}

Syntax #

reflect()