Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: backGroundOptionsZone is not defined' in or related to this line: 'game.addChild(backGroundOptionsZone);' Line Number: 351
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: setScore is not defined' in or related to this line: 'setScore(0);' Line Number: 396
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: clueWord is not defined' in or related to this line: 'if (clueWord != '') {' Line Number: 601
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: mainGrid.findNclick is not a function' in or related to this line: 'mainGrid.findNclick(firstLetter);' Line Number: 506
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: setClueButtonWord is not defined' in or related to this line: 'setClueButtonWord('ButtonClue1');' Line Number: 380
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: clueWord is undefined' in or related to this line: 'var letter = clueWord[clueLevel - 1];' Line Number: 487
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: 'Timeout.tick error: mainGrid.cells[line] is undefined' in or related to this line: 'if (mainGrid.cells[line][col]) {' Line Number: 453
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: word is undefined' in or related to this line: 'var wordShuffled = wordShuffled = word.split('').sort(function () {' Line Number: 495
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: pickAndShakeSingleWord is not defined' in or related to this line: 'var word = pickAndShakeSingleWord().word;' Line Number: 495
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: maingrid is not defined' in or related to this line: 'if (maingrid) {' Line Number: 547
Code edit (1 edits merged)
Please save this source code
Code edit (18 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: clueButton is null' in or related to this line: 'clueButton = new Button('', {' Line Number: 433
===================================================================
--- original.js
+++ change.js
@@ -187,8 +187,19 @@
self.emptyCells.push(self.cells[line][column]);
}
}
}; //Fin de la fonction removeLetter
+ self.findNclickCell = function (letter) {
+ //Trouve et clique sur la première cellule contenant la lettre letter
+ for (var i = 0; i < self.gridLines; i++) {
+ for (var j = 0; j < self.gridColumns; j++) {
+ if (self.cells[i][j].letter === letter) {
+ self.cells[i][j].onClickCell();
+ return;
+ }
+ }
+ }
+ }; //Fin de la fonction findNclickCell
self.addWord = function (word) {
// Add a word in the list of words
self.words.push(word);
}; //Fin de la fonction addWord
@@ -358,8 +369,9 @@
var clueLevel = 0; //Niveau d'indice
var clueButton = new Button('', {});
setClueButton('buttonClue');
setClueButtonWord('ButtonClue1');
+setClueButtonDrop('ButtonClue2');
/****
* Functions
****/
function updateScoreTest(nouveauScore) {
@@ -471,17 +483,9 @@
var randomIndex = Math.floor(Math.random() * mainGrid.words.length);
var word = mainGrid.words[randomIndex];
clueWord = word; //On garde le mot pour le prochain indice
var firstLetter = word[0];
- var isLetterFound = false;
- for (var i = 0; i < mainGrid.gridLines; i++) {
- for (var j = 0; j < mainGrid.gridColumns; j++) {
- if (mainGrid.cells[i][j].letter == firstLetter && !isLetterFound) {
- mainGrid.cells[i][j].onClickCell();
- isLetterFound = true;
- }
- }
- }
+ mainGrid.findNclickCell(firstLetter);
}
break;
default:
//On descend les lettres d'un mot
@@ -523,9 +527,9 @@
},
onClick: onClickClueButton
});
clueButton.x = game.width - clueButton.width; // Adjust x position after initialization
- clueButton.y = clueButton.height / 2; // Adjust y position after initialization
+ clueButton.y = mainGrid.y + clueButton.height; // Adjust y position after initialization
game.addChild(clueButton);
} //Fin de la fonction setClueButton
//Fonction onClickClueButtonWord : permet de donner un indice au joueur (change la couleur des lettres d'un des mots au hasard)
function onClickClueButtonWord() {
@@ -544,9 +548,9 @@
}
} //Fin de la fonction onClickClueButtonWord
//Fonction setClueButtonWord : permet de définir le bouton d'indice focus word
function setClueButtonWord(asset) {
- clue1Button = new Button('', {
+ clueButtonWord = new Button('', {
assetName: asset,
x: game.width / 2 - 350,
y: mainGrid.y,
// Set a default y position
@@ -558,12 +562,36 @@
fill: "#000000"
},
onClick: onClickClueButtonWord
});
- clue1Button.x = game.width - clue1Button.width; // Adjust x position after initialization
- clue1Button.y = clue1Button.height / 2; // Adjust y position after initialization
- game.addChild(clue1Button);
+ clueButtonWord.x = game.width - clueButtonWord.width; // Adjust x position after initialization
+ clueButtonWord.y = mainGrid.y + 2 * clueButtonWord.height; // Adjust y position after initialization
+ game.addChild(clueButtonWord);
} //Fin de la fonction setClueButtonWord
+//Fonction onClickClueButtonDrop : permet de donner un indice au joueur (drop letter)
+function onClickClueButtonDrop() {
+ return; //Pas encore implémenté
+} //Fin de la fonction onClickClueButtonDrop
+//Fonction setClueButtonDrop : permet de définir le bouton d'indice drop letter
+function setClueButtonDrop(asset) {
+ clueButtonDrop = new Button('', {
+ assetName: asset,
+ x: game.width / 2 - 350,
+ y: mainGrid.y,
+ // Set a default y position
+ width: 200,
+ height: 200,
+ fill: "#00FF00",
+ text: {
+ size: 50,
+ fill: "#000000"
+ },
+ onClick: onClickClueButtonDrop
+ });
+ clueButtonDrop.x = game.width - clueButtonDrop.width; // Adjust x position after initialization
+ clueButtonDrop.y = mainGrid.y + 3 * clueButtonDrop.height; // Adjust y position after initialization
+ game.addChild(clueButtonDrop);
+} //Fin de la fonction setClueButtonDrop
//Fonction initWordGrid : permet d'initialiser la grille des lettres formant le mot
function initWordGrid() {
//Initialise la grille des lettres formant le mot
wordGrid = game.addChild(new LettersGrid(0, 1, 'cellWord'));
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.