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
@@ -88,9 +88,11 @@
self.cells = [];
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;
@@ -103,11 +105,30 @@
this.onClickCell();
});
cell.clickable = self.clickable;
self.emptyCells.push(cell);
+ 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++) {
@@ -218,8 +239,12 @@
var mainGrid = game.addChild(new LettersGrid(6, 6, 'cell'));
mainGrid.initializeGrid();
mainGrid.x = (game.width - mainGrid.gridColumns * mainGrid.cellSize) / 2;
mainGrid.y = ScoreZone.height + 2 * lettersGrid.height;
+var wordGrid = game.addChild(new LettersGrid(1, 1, 'cellWord'));
+wordGrid.initializeGrid();
+wordGrid.x = (game.width - wordGrid.gridColumns * wordGrid.cellSize) / 2;
+wordGrid.y = ScoreZone.height + 3 * lettersGrid.height;
var lettersToAdd = [];
var finalWord = [];
var currentLetterIndex = 0;
var wordsToBegin = pickAndShakeWords(1); // Pick and shuffle words from the main list
@@ -269,29 +294,8 @@
mainGrid.addRandomLetter(lettersToAdd[0]);
lettersToAdd.splice(0, 1);
}
} //Fin de la fonction transfertLettersToMainGrid
-//Fonction addCellLetterToWord : permet d'ajouter une cellule à la liste des lettres formant le mot sous la grille
-function addCellLetterToWord(cell) {
- var cellSize = 128;
- var cellLetter = new GridCell(cell.letter, 'cellWord');
- cellLetter.x = game.width / 2 + cellSize * (finalWord.length / 2);
- cellLetter.y = ScoreZone.height + 3 * lettersGrid.height + cellSize / 2;
- cellLetter.policeSize = 70;
- cellLetter.texte.setStyle({
- size: cellLetter.policeSize
- });
- cellLetter.on('down', function () {
- //Fonction appelée lors du click sur la cellule
- if (cellLetter.isClicked) {
- cellLetter.isClicked = false;
- cellLetter.setColorToLetter("#ffffff");
- finalWord.splice(finalWord.indexOf(cellLetter.letter), 1);
- }
- });
- word.push(cellLetter.letter);
- game.addChild(cellLetter);
-} //Fin de la fonction addCellLetterToWord
game.update = function () {
updateScoreTest(scoreTest);
if (LK.ticks % 60 == 0) {
//Si la liste des lettres à ajouter n'est pas vide, on ajoute toutes les lettres puis on supprime les lettres de la liste
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.