Skip to content
Snippets Groups Projects
Commit d2b3dae3 authored by Silas Dohm's avatar Silas Dohm
Browse files

g

parent 337cc692
No related branches found
No related tags found
No related merge requests found
class Cell {
constructor(x, y, char, hintNr = 0) {
constructor(x, y) {
this.x = x;
this.y = y;
this.currentChar = '';
this.actualChar = char;
this.hintNr = hintNr;
this.actualChar = '';
this.hintNr = 0;
this.word = new Array(2)
this.neighbour = new Array(4); //0=left, 1=top, 2=right, 3=bot
}
......@@ -83,7 +83,7 @@ class Word {
this.chars.forEach(element => {
let color = this.highlightColor;
if (element == activeCell)
color = direction ? '#ffe553' : '#ffab58';
color = activeDir ? '#ffe553' : '#ffab58';
if (element.currentChar.toUpperCase() == element.actualChar.toUpperCase()) {
element.draw(color, "green");
}
......
......@@ -6,7 +6,7 @@ ctx.canvas.height = size * rows;
for (i = 0; i < columns; i++) {
cells[i] = new Array(rows); //make array 2D
for (j = 0; j < rows; j++) {
cells[i][j] = new Cell(i, j, ""); //create array of empty cells
cells[i][j] = new Cell(i, j); //create array of empty cells
}
}
words.push(new Word("einverstanden", "okay", 1, 1, 0));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment