class Checkerboard extends Layer { // Checkerboard color 1 firstCheckerBoardColor = 'rgba(179, 173, 182, 1)'; // Checkerboard color 2 secondCheckerBoardColor = 'rgba(204, 200, 206, 1)'; // Square size for the checkerboard checkerBoardSquareSize = 16; // Setting current colour (each square has a different colour currentColor = undefined; // Saving number of squares filled until now nSquaresFilled = 0; constructor(width, height, canvas, menuEntry) { super(width, height, document.getElementById('checkerboard'), menuEntry); this.initialize(); } initialize() { super.initialize(); ////console.log("Square size: " + this.checkerBoardSquareSize); this.currentColor = this.firstCheckerBoardColor; this.fillCheckerboard(); } /** Fills the checkerboard canvas with squares with alternating colours * */ fillCheckerboard() { this.context.clearRect(0, 0, currFile.canvasSize[0], currFile.canvasSize[1]); // Cycling through the canvas (using it as a matrix) for (let i=0; i