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
@@ -272,9 +272,8 @@
/****
* Game Code
****/
-var clueWord = '';
// Button class for creating buttons in the game
/****
* GAME DESCRIPTION:
* Game Principle:
@@ -313,8 +312,12 @@
var planetesNsatellites = ["SUN", "MERCURY", "VENUS", "EARTH", "MOON", "MARS"];
var scoreTest = 0; // Define scoreTest variable
var isScoreUpdatable = false; // Autorise ou pas la mise à jour du score
var score = 0;
+var clueWord = '';
+var costForLetter = 10; //Coût pour l'indice de la première lettre
+var costForWord = 5; //Coût pour l'indice du mot
+var costForDrop = 10; //Coût pour l'indice drop letter
/****
* Game zones and backgrounds
****/
var ScoreZone = {
@@ -527,9 +530,9 @@
}
} //Fin de la fonction onClickClueButtonLetter
//Fonction setClueButtonFirstLetter : permet de définir le bouton d'indice
function setClueButtonFirstLetter(asset) {
- clueButton = new Button('', {
+ clueButtonLetter = new Button('', {
assetName: asset,
x: game.width / 2 - 350,
y: 150,
// Set a default y position
@@ -541,11 +544,11 @@
fill: "#000000"
},
onClick: onClickClueButtonLetter
});
- 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.x = game.width - clueButtonLetter.width; // Adjust x position after initialization
+ clueButtonLetter.y = mainGrid.y + clueButtonLetter.height; // Adjust y position after initialization
+ game.addChild(clueButtonLetter);
} //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()) {
@@ -558,9 +561,9 @@
var word = mainGrid.words[randomIndex];
mainGrid.colorWordCells(word, "#FF5500");
LK.setTimeout(function () {
mainGrid.colorWordCells(word, "#000000");
- scrollCostCoins(clueButtonWord.x, clueButtonWord.y, word.length, 5);
+ scrollCostCoins(clueButtonWord.x, clueButtonWord.y, word.length, costForWord);
}, 3000);
}
} //Fin de la fonction onClickClueButtonWord
//Fonction setClueButtonWord : permet de définir le bouton d'indice focus word
@@ -600,18 +603,18 @@
var secondLetter = word[1];
mainGrid.findNclickCell(firstLetter);
LK.setTimeout(function () {
mainGrid.findNclickCell(secondLetter);
- scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 2, 10);
+ scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 2, costForDrop);
}, 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);
+ scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 1, costForDrop);
}
break;
} //Fin du switch
clueLevel++;
@@ -854,14 +857,20 @@
validateButton.visible = true;
}
}
//Affichage ou pas des boutons d'indices
- var notEnoughtMoney = longuestWord(mainGrid.words) * 10 > score;
- if (notEnoughtMoney || !wordGrid.isEmpty()) {
+ var notEnoughtMoneyForWord = longuestWord(mainGrid.words) * costForWord > score;
+ if (notEnoughtMoneyForWord || !wordGrid.isEmpty()) {
clueButtonWord.visible = false;
} else {
clueButtonWord.visible = true;
}
+ var notEnoughtMoneyForDrop = longuestWord(mainGrid.words) * costForDrop > score;
+ if (notEnoughtMoneyForDrop || !wordGrid.isEmpty()) {
+ clueButtonDrop.visible = false;
+ } else {
+ clueButtonDrop.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.