Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: word is not defined' in or related to this line: 'scoreTest = "firtWord: " + word;' Line Number: 922
Code edit (1 edits merged)
Please save this source code
Code edit (15 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: wordGgrid is not defined' in or related to this line: 'var letter = clueWord[wordGgrid.gridColumns];' Line Number: 633
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: wordOfGrid is undefined' in or related to this line: 'if (notEnoughtMoneyForDrop || clueWord == '' && !wordGrid.isEmpty() || clueWord.length < wordOfGrid.length) {' Line Number: 903
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: wordGrid.words[0] is undefined' in or related to this line: 'return true;' Line Number: 267
Code edit (1 edits merged)
Please save this source code
Code edit (20 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: clueButtonLetter is not defined' in or related to this line: 'scrollCostCoins(clueButtonLetter.x, clueButtonLetter.y, 1, 10);' Line Number: 549
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: 'Timeout.tick error: options is undefined' in or related to this line: 'var imageToScrollRescale = {' Line Number: 775
Code edit (15 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: options is undefined' in or related to this line: 'var imageToScrollRescale = {' Line Number: 775
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: options is undefined' in or related to this line: 'var imageToScrollRescale = {' Line Number: 748
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: createRewardImages is not defined' in or related to this line: 'createRewardImages('RewardsCoin', tableauFrom);' Line Number: 469
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: imagesToScrollRescale[i] is undefined' in or related to this line: 'if (imagesToScrollRescale[i].isDestroyedOnEnd) {' Line Number: 725
===================================================================
--- original.js
+++ change.js
@@ -221,8 +221,16 @@
if (self.words.includes(word)) {
self.words.splice(self.words.indexOf(word), 1);
}
}; //Fin de la fonction removeWord
+ self.firstWord = function () {
+ // Return the first word in the list of words
+ var word = '';
+ for (var i = 0; i < self.gridColumns; i++) {
+ word += self.cells[0][i].letter;
+ }
+ return word;
+ }; //Fin de la fonction firstWord
self.isFull = function () {
for (var i = 0; i < self.gridLines; i++) {
for (var j = 0; j < self.gridColumns; j++) {
if (self.cells[i][j].letter === '') {
@@ -382,11 +390,11 @@
var clueButtonWord = null;
var clueButtonDrop = null;
var animatingImageOn = false; //Drapeau indiquant qu'une image est a scrollscaller
var imagesToScrollRescale = []; //Liste des images a scrollscaller
-initGameThema(planetesNsatellites, 'BackGroundPlanetesNSatellites');
+//initGameThema(planetesNsatellites, 'BackGroundPlanetesNSatellites');
//initGameThema(usaStates, 'BackGroundUSAStates');
-//initGameThema(europeanCapitales, 'BackGroundEuropeanCapitales');
+initGameThema(europeanCapitales, 'BackGroundEuropeanCapitales');
/****
* Functions
****/
//Fonction initGameThema : permet d'initialiser le thème du jeu (liste des mots et image de fond)
@@ -603,18 +611,18 @@
}, 100);
}
} else if (!wordGrid.isEmpty() && clueWord != '') {
//On reconstitue le mot contenu dans wordGrid
- var word = '';
- for (var i = 0; i < wordGrid.gridColumns; i++) {
- word += wordGrid.cells[0][i].letter;
- }
- scoreTest = "wordGrid: " + word + " / clueWord: " + clueWord.substring(0, wordGrid.gridColumns);
+ var word = wordGrid.firstWord();
if (word == clueWord.substring(0, wordGrid.gridColumns)) {
var letter = clueWord[wordGrid.gridColumns];
//On descend la suite du mot
mainGrid.findNclickCell(letter);
- scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 1, costForDrop);
+ if (word != clueWord) {
+ scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 1, costForDrop);
+ } else if (word == clueWord && word != '') {
+ clueWord = '';
+ }
} else {
//On réinitialise les parametres de l'indice drop letter
clueWord = '';
}
@@ -848,8 +856,26 @@
mainGrid.emptyCells.push(mainGrid.cells[i][j]);
}
}
}
+ //Recherche de la lettre cliquée dans la wordGrid et retour de la lettre à la mainGrid
+ var indexCellToRemove = -1;
+ for (var j = 0; j < wordGrid.gridColumns; j++) {
+ if (wordGrid.cells[0][j].isClicked) {
+ //Retour de la lettre à la grille principale
+ var columnBack = wordGrid.cells[0][j].columnFrom;
+ var lineBack = wordGrid.cells[0][j].lineFrom;
+ mainGrid.setLetter(columnBack, lineBack, wordGrid.cells[0][j].letter);
+ //Retrait de la lettre cliquée du mot
+ wordGrid.cells[0][j].setLetter('');
+ wordGrid.cells[0][j].isClicked = false;
+ indexCellToRemove = j;
+ }
+ }
+ if (indexCellToRemove >= 0) {
+ wordGrid.removeCell(indexCellToRemove);
+ indexCellToRemove = -1;
+ }
//Affichage ou pas du bouton de validation
if (validateButton) {
if (wordGrid.isEmpty()) {
validateButton.visible = false;
@@ -868,38 +894,16 @@
clueButtonWord.visible = false;
} else {
clueButtonWord.visible = true;
}
+ var word = wordGrid.firstWord();
+ scoreTest = "firtWord: " + word;
var notEnoughtMoneyForDrop = longuestWord(mainGrid.words) * costForDrop > score;
if (notEnoughtMoneyForDrop || clueWord == '' && !wordGrid.isEmpty()) {
clueButtonDrop.visible = false;
} else {
clueButtonDrop.visible = true;
}
- //if (!wordGrid.isEmpty() && clueLevel > 0) {
- // if (wordGrid.gridColumns - 1 != clueLevel) {
- // clueButtonDrop.visible = false;
- // clueLevel = 0;
- // clueWord = '';
- // }
- //Recherche de la lettre cliquée dans la wordGrid et retour de la lettre à la mainGrid
- var indexCellToRemove = -1;
- for (var j = 0; j < wordGrid.gridColumns; j++) {
- if (wordGrid.cells[0][j].isClicked) {
- //Retour de la lettre à la grille principale
- var columnBack = wordGrid.cells[0][j].columnFrom;
- var lineBack = wordGrid.cells[0][j].lineFrom;
- mainGrid.setLetter(columnBack, lineBack, wordGrid.cells[0][j].letter);
- //Retrait de la lettre cliquée du mot
- wordGrid.cells[0][j].setLetter('');
- wordGrid.cells[0][j].isClicked = false;
- indexCellToRemove = j;
- }
- }
- if (indexCellToRemove >= 0) {
- wordGrid.removeCell(indexCellToRemove);
- indexCellToRemove = -1;
- }
//Autres actions à effectuer sans urgence
if (LK.ticks % 10 == 0) {
//Chargement initiale de la grille principale si nécessaire (vide):
//mot(s) est choisi au hasard dans la liste principale,
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.