Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (wordsMainList.length == 0) {' Line Number: 723
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (wordsMainList.length == 0) {' Line Number: 723
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (wordsMainList.length == 0) {' Line Number: 722
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'var randomIndex = Math.floor(Math.random() * wordsMainList.length);' Line Number: 723
User prompt
Please fix the bug: 'ReferenceError: i is not defined' in or related to this line: 'initGameThema(mainListsList[i], backGroundsList[i]);' Line Number: 459
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading '0')' in or related to this line: 'if (mainGrid.cells[i][j].isClicked) {' Line Number: 909
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -377,8 +377,9 @@
var isWordValid = false; //Indique si le mot formé est valide
var validateButton = null;
var clueLevel = 0; //Niveau d'indice
var clueButton = null;
+var clueButtonLetter = null;
var clueButtonWord = null;
var clueButtonDrop = null;
var animatingImageOn = false; //Drapeau indiquant qu'une image est a scrollscaller
var imagesToScrollRescale = []; //Liste des images a scrollscaller
@@ -520,18 +521,9 @@
}
LK.setTimeout(function () {
if (mainGrid.cells[line] && mainGrid.cells[line][col]) {
mainGrid.cells[line][col].setColorToLetter("#000000");
- var image = createImageToSrollRescale('CostCoin', game.width / 2, MainZone.y - scoreText.height / 2, {
- xToReach: clueButton.x,
- yToReach: clueButton.y,
- nbTicksLeft: 30,
- valueToAddToScore: -10,
- soundOnEnd: 'SoundCostCoin',
- isDestroyedOnEnd: true,
- animate: true
- });
- imagesToScrollRescale.push(image);
+ scrollCostCoins(clueButtonLetter.x, clueButtonLetter.y, 1, 10);
}
}, 2000);
}
} //Fin de la fonction onClickClueButtonLetter
@@ -553,8 +545,9 @@
});
clueButton.x = game.width - clueButton.width; // Adjust x position after initialization
clueButton.y = mainGrid.y + clueButton.height; // Adjust y position after initialization
game.addChild(clueButton);
+ clueButtonLetter = clueButton;
} //Fin de la fonction setClueButtonFirstLetter
//Fonction onClickClueButtonWord : permet de donner un indice au joueur (change la couleur des lettres d'un des mots au hasard)
function onClickClueButtonWord() {
if (!wordGrid.isEmpty()) {
@@ -567,20 +560,9 @@
var word = mainGrid.words[randomIndex];
mainGrid.colorWordCells(word, "#FF5500");
LK.setTimeout(function () {
mainGrid.colorWordCells(word, "#000000");
- for (var i = 0; i < word.length; i++) {
- var image = createImageToSrollRescale('CostCoin', game.width / 2, MainZone.y - scoreText.height / 2, {
- xToReach: clueButtonWord.x,
- yToReach: clueButtonWord.y,
- nbTicksLeft: 30 + i * 10,
- valueToAddToScore: -10,
- soundOnEnd: 'SoundCostCoin',
- isDestroyedOnEnd: true,
- animate: true
- });
- imagesToScrollRescale.push(image);
- }
+ scrollCostCoins(clueButtonWord.x, clueButtonWord.y, word.length, 5);
}, 3000);
}
} //Fin de la fonction onClickClueButtonWord
//Fonction setClueButtonWord : permet de définir le bouton d'indice focus word
@@ -620,16 +602,18 @@
var secondLetter = word[1];
mainGrid.findNclickCell(firstLetter);
LK.setTimeout(function () {
mainGrid.findNclickCell(secondLetter);
+ scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 2, 10);
}, 100);
}
break;
default:
//On descend les lettres d'un mot
if (clueWord != '') {
var letter = clueWord[clueLevel + 1];
mainGrid.findNclickCell(letter);
+ scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 1, 10);
}
break;
} //Fin du switch
clueLevel++;
@@ -765,8 +749,23 @@
var image = createImageToSrollRescale(asset, tableauFrom[i].x, tableauFrom[i].y, options);
imagesToScrollRescale.push(image);
}
} //fin createImages
+//Fonction scrollCostCoins : permet de faire défiler des pièces de monnaie
+function scrollCostCoins(xTo, yTo, nbCoins, valueToTakeFromScore) {
+ for (var i = 0; i < nbCoins; i++) {
+ var image = createImageToSrollRescale('CostCoin', game.width / 2, MainZone.y - scoreText.height / 2, {
+ xToReach: xTo,
+ yToReach: yTo,
+ nbTicksLeft: 30 + i * 2,
+ valueToAddToScore: -valueToTakeFromScore,
+ soundOnEnd: 'SoundCostCoin',
+ isDestroyedOnEnd: true,
+ animate: true
+ });
+ imagesToScrollRescale.push(image);
+ }
+} //fin scrollCostCoins
//Fonction scrollRescaleImages permettant de faire défiler et redimensionner des images
function scrollRescaleImages() {
for (var i = 0; i < imagesToScrollRescale.length; i++) {
if (imagesToScrollRescale[i].animate) {
@@ -810,8 +809,19 @@
}
}
}
} //fin scrollRescaleImages
+//Fonction longuestWord : permet de trouver le mot le plus long dans une liste de mots et de donner sa longueur
+function longuestWord(liste) {
+ var longuest = '';
+ for (var i = 0; i < liste.length; i++) {
+ if (liste[i].length > longuest.length) {
+ longuest = liste[i];
+ }
+ }
+ scoreTest = "Longuest : " + longuest;
+ return longuest.length;
+} //Fin de la fonction longuestWord
/****
* Main loop
****/
game.update = function () {
@@ -845,8 +855,15 @@
} else {
validateButton.visible = true;
}
}
+ //Affichage ou pas des boutons d'indices
+ var notEnoughtMoney = longuestWord(mainGrid.words) * 10 > score;
+ if (notEnoughtMoney || !wordGrid.isEmpty()) {
+ clueButtonWord.visible = false;
+ } else {
+ clueButtonWord.visible = true;
+ }
//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) {
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.