Code edit (23 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: Button is not defined' in or related to this line: 'var validateButton = new Button('Validate', {' Line Number: 271
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: columnFrom is not defined' in or related to this line: 'scoreTest = columnFrom;' Line Number: 89
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: cells is not defined' in or related to this line: 'mainGrid.cells[i][j].setLetter(cells[i][j].columnFrom, cells[i][j].lineFrom, wordGrid.cells[i][j].letter);' Line Number: 346
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: newLetter.toUpperCase is not a function' in or related to this line: 'self.texte.setText(newLetter.toUpperCase());' Line Number: 71
User prompt
Please fix the bug: 'ReferenceError: cells is not defined' in or related to this line: 'mainGrid.cells[i][j].setLetter(cells[i][j].column, cells[i][j].line, wordGrid.cells[i][j].letter);' Line Number: 342
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: wordGrid.cells[i][j].removeCell is not a function' in or related to this line: 'wordGrid.cells[i][j].removeCell(j);' Line Number: 342
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self.cells[i][j] is undefined' in or related to this line: 'if (self.cells[i][j].letter !== '') {' Line Number: 192
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self.cells[i][j] is undefined' in or related to this line: 'if (self.cells[i][j].letter !== '') {' Line Number: 192
User prompt
Please fix the bug: 'TypeError: self.cells[i][j] is undefined' in or related to this line: 'if (self.cells[i][j].letter !== '') {' Line Number: 192
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: word is not defined' in or related to this line: 'cellLetter.x = game.width / 2 + cellSize * (word.length / 2);' Line Number: 285
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -73,9 +73,9 @@
return;
}
self.isClicked = true;
self.setColorToLetter("#FF0000");
- //addCellLetterToWord(self);
+ addCellLetterToWord(self);
};
self.isClicked = false; //Indique si la cellule a été cliquée
});
// LettersGrid class for managing the grid of letters, same as WordGrid but with control of number of columns and lines
@@ -89,8 +89,11 @@
self.emptyCells = []; //Liste des cellules vides
self.initializeGrid = function () {
for (var i = 0; i < self.gridLines; i++) {
self.cells[i] = [];
+ if (!self.cells[i]) {
+ self.cells[i] = [];
+ }
for (var j = 0; j < self.gridColumns; j++) {
var cell = new GridCell('', assetName);
cell.x = j * self.cellSize + self.cellSize / 2;
cell.y = i * self.cellSize + self.cellSize / 2;
@@ -107,13 +110,31 @@
return cell;
}
}
}; //Fin de la fonction initializeGrid
+ self.addCell = function () {
+ //Ajoute une cellule à la grille dans le cas ou il n'y a qu'une seule ligne
+ if (self.gridLines === 1) {
+ var cell = new GridCell('', assetName);
+ cell.x = self.cells[0].length * self.cellSize + self.cellSize / 2;
+ cell.y = self.cellSize / 2;
+ self.addChild(cell);
+ self.cells[0].push(cell);
+ cell.column = self.cells[0].length - 1;
+ cell.line = 0;
+ cell.on('down', function () {
+ //Fonction appelée lors du click sur la cellule
+ this.onClickCell();
+ });
+ cell.clickable = self.clickable;
+ self.emptyCells.push(cell);
+ }
+ }; //Fin de la fonction addCell
self.addLetter = function (letter) {
var added = false;
for (var i = 0; i < self.gridLines && !added; i++) {
for (var j = 0; j < self.gridColumns && !added; j++) {
- if (self.cells[i][j].letter === '') {
+ if (self.cells[i] && self.cells[i][j] && self.cells[i][j].letter === '') {
self.cells[i][j].setLetter(letter);
added = true;
//Retrait de la cellule de la liste des cellules vides
if (self.emptyCells.includes(self.cells[i][j])) {
@@ -150,8 +171,11 @@
}
}; //Fin de la fonction removeLetter
self.isFull = function () {
for (var i = 0; i < self.gridLines; i++) {
+ if (!self.cells[i]) {
+ continue;
+ }
for (var j = 0; j < self.gridColumns; j++) {
if (self.cells[i][j].letter === '') {
return false;
}
@@ -160,8 +184,11 @@
return true;
}; //Fin de la fonction isFull
self.isEmpty = function () {
for (var i = 0; i < self.gridLines; i++) {
+ if (!self.cells[i]) {
+ continue;
+ }
for (var j = 0; j < self.gridColumns; j++) {
if (self.cells[i][j].letter !== '') {
return false;
}
@@ -170,8 +197,11 @@
return true;
}; //Fin de la fonction isEmpty
self.colorAllCells = function (color) {
for (var i = 0; i < self.gridLines; i++) {
+ if (!self.cells[i]) {
+ continue;
+ }
for (var j = 0; j < self.gridColumns; j++) {
self.cells[i][j].setColorToLetter(color);
}
}
An empty cell.
Drapeau national des USA en fond d'un patchwork des États américains.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Une jeton de scrabble sans lettre.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Un bouton arrondi suggérant une validation mais sans texte écrit dessus.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A round button with a cyan interrogation mark.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A round cyan button with a yellow lamp bulb.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Planetes.
Remove the white square and the red lines.
A patchwork of european countries with the european unio flag in back ground.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A yellow coin wher we can see '+10' written on it.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A red coin wher we can see '-10' written on it... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Patchwork of heads of plenty animals.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
The periodic table of the elements.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Patchwork de mots sur un fond cyan.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Patchwork of scene extracted from video games.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
It is written "COOL QUIZZ".
A cyan circle button with a home silhouette in the center. The button means "go back to start window". Avoid white color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.