Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -99,9 +99,9 @@
if (!self.clickable || self.letter == '') {
return;
}
self.isClicked = true;
- self.setColorToLetter("#FF0000");
+ self.setColorToLetter("#FF00FF");
};
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
@@ -282,17 +282,42 @@
var wordGrid = game.addChild(new LettersGrid(0, 1, 'cellWord'));
wordGrid.initializeGrid();
wordGrid.x = (game.width - wordGrid.width) / 2 - wordGrid.height / 2 + lettersGrid.height / 2;
wordGrid.y = ScoreZone.height + lettersGrid.height + mainGrid.height + 2 * lettersGrid.height;
-var validateButton = new Button('Validate', {
- x: (game.width - 200) / 2,
- y: ScoreZone.height + lettersGrid.height + mainGrid.height + 2 * lettersGrid.height + wordGrid.height,
+var validateButton = new Button('', {
+ x: game.width / 2,
+ y: wordGrid.y + wordGrid.height + 300,
width: 200,
- height: 100,
+ height: 200,
fill: "#00FF00",
text: {
size: 50,
fill: "#000000"
+ },
+ onClick: function onClick() {
+ //Fonction appelée lors du click sur le bouton de validation
+ if (validateWord()) {
+ //Le mot est valide, on ajoute les lettres à la grille principale
+ for (var i = 0; i < wordGrid.gridColumns; i++) {
+ mainGrid.setLetter(i, 0, '');
+ }
+ //On vide la grille des lettres formant le mot
+ wordGrid.gridColumns = 0;
+ wordGrid.initializeGrid();
+ wordGrid.x = (game.width - wordGrid.width) / 2 - wordGrid.height / 2 + lettersGrid.height / 2;
+ wordGrid.y = ScoreZone.height + lettersGrid.height + mainGrid.height + 2 * lettersGrid.height;
+ isMGRefillrequired = true;
+ } else {
+ //Le mot n'est pas valide, on remet les lettres dans la grille principale
+ for (var i = 0; i < wordGrid.gridColumns; i++) {
+ wordGrid.cells[0][i].isClicked;
+ }
+ //wordGrid.gridColumns = 0;
+ //wordGrid.initializeGrid();
+ //wordGrid.x = (game.width - wordGrid.width) / 2 - wordGrid.height / 2 + lettersGrid.height / 2;
+ //wordGrid.y = ScoreZone.height + lettersGrid.height + mainGrid.height + 2 * lettersGrid.height;
+ isMGRefillrequired = true;
+ }
}
});
game.addChild(validateButton);
var lettersToAdd = []; //File d'attente des lettres à ajouter dans la lettersGrid
@@ -361,8 +386,9 @@
return isWordValid;
} //Fin de la fonction validateWord
game.update = function () {
updateScoreTest(scoreTest);
+ scoreTest = wordGrid.x;
//Recherche de la lettre cliquée dans la mainGrid et ajout de la lettre à la liste des lettres formant le mot
for (var i = 0; i < mainGrid.gridLines; i++) {
for (var j = 0; j < mainGrid.gridColumns; j++) {
if (mainGrid.cells[i][j].isClicked) {
@@ -402,9 +428,8 @@
//il est mélangé et les lettres sont directement ajoutées à la grille principale avec la fonction addRandomLetter
if (mainGrid.isEmpty() && !isGameStarted) {
var wordsToBegin = pickAndShakeWords(1);
if (wordsToBegin.length > 0) {
- scoreTest = "Fist word: " + wordsToBegin;
for (var i = 0; i < wordsToBegin[0].length; i++) {
mainGrid.addRandomLetter(wordsToBegin[0][i]);
}
isGameStarted = true;
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.