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
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
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'y')' in or related to this line: 'var validateButton = new Button('', {' Line Number: 302
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'self.width = options.width || 200;' Line Number: 56
===================================================================
--- original.js
+++ change.js
@@ -248,9 +248,28 @@
/****
* Game Code
****/
-//var wordsMainListTest = ["AARDVARK", "ALBATROSS", "ALLIGATOR", "ALPACA", "ANT"]; //The real main list is at the end
+// Function setClueButtonWord: sets the word for the clue button
+function setClueButtonWord(asset) {
+ clueButton = new Button('', {
+ assetName: asset,
+ x: game.width / 2 - 350,
+ y: 150,
+ width: 200,
+ height: 200,
+ fill: "#00FF00",
+ text: {
+ size: 50,
+ fill: "#000000"
+ },
+ onClick: onClickClueButtonWord
+ });
+ clueButton.x = game.width - clueButton.width; // Adjust x position after initialization
+ clueButton.y = clueButton.height / 2; // Adjust y position after initialization
+ game.addChild(clueButton);
+} // End of setClueButtonWord function
+// Button class for creating buttons in the game
/****
* GAME DESCRIPTION:
* Game Principle:
* -There is a board filled with letters, where the player selects letters from a partially filled grid.
@@ -278,9 +297,9 @@
* If the word is not valid, the letters forming the word are returned to their original position in the grid.
* A new word appears randomly within the grid to empty spaces.
* If there is no more space in the grid, the game is over.
****/
-// Button class for creating buttons in the game
+//var wordsMainListTest = ["AARDVARK", "ALBATROSS", "ALLIGATOR", "ALPACA", "ANT"]; //The real main list is at the end
var usaStates = ["ALABAMA", "ALASKA", "ARIZONA", "ARKANSAS", "CALIFORNIA", "COLORADO", "CONNECTICUT", "DELAWARE", "FLORIDA", "GEORGIA", "HAWAII", "IDAHO", "ILLINOIS", "INDIANA", "IOWA", "KANSAS", "KENTUCKY", "LOUISIANA", "MAINE", "MARYLAND", "MASSACHUSETTS", "MICHIGAN", "MINNESOTA", "MISSISSIPPI", "MISSOURI", "MONTANA", "NEBRASKA", "NEVADA", "NEW-HAMPSHIRE", "NEW-JERSEY", "NEW-MEXICO", "NEW-YORK", "NORTH-CAROLINA", "NORTH-DAKOTA", "OHIO", "OKLAHOMA", "OREGON", "PENNSYLVANIA", "RHODE-ISLAND", "SOUTH-CAROLINA", "SOUTH-DAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VERMONT", "VIRGINIA", "WASHINGTON", "WEST-VIRGINIA", "WISCONSIN", "WYOMING"];
var europeanCapitales = ["AMSTERDAM", "ANDORRA-LA-VELLA", "ANKARA", "ATHENS", "BELGRADE", "BERLIN", "BERN", "BRATISLAVA", "BRUSSELS", "BUCHAREST", "BUDAPEST", "CHISINAU", "COPENHAGEN", "DUBLIN", "HELSINKI", "KIEV", "LISBON", "LJUBLJANA", "LONDON", "LUXEMBOURG", "MADRID", "MINSK", "MONACO", "MOSCOW", "NICOSIA", "OSLO", "PARIS", "PODGORICA", "PRAGUE", "REYKJAVIK", "RIGA", "ROME", "SAN-MARINO", "SARAJEVO", "SKOPJE", "SOFIA", "STOCKHOLM", "TALLINN", "TBILISI", "TIRANA", "VADUZ", "VALLETTA", "VIENNA", "VILNIUS", "WARSAW", "ZAGREB"];
//var planetesNsatellites = ["SUN", "MERCURY", "VENUS", "EARTH", "MOON", "MARS", "PHOBOS", "DEIMOS", "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO", "SATURN", "TITAN", "MIMAS", "ENCELADUS", "TETHYS", "DIONE", "RHEA", "HYPERION", "LAPETUS", "PHOEBE", "URANUS", "PUCK", "MIRANDA", "ARIEL", "UMBRIEL", "TITANIA", "OBERON", "NEPTUNE", "TRITON", "PROTEUS", "NEREID", "PLUTO", "CHARON"];
var planetesNsatellites = ["SUN", "MERCURY", "VENUS", "EARTH", "MOON", "MARS"];
@@ -357,8 +376,9 @@
setValidateButton('buttonValidate');
var clueLevel = 0; //Niveau d'indice
var clueButton = new Button('', {});
setClueButton('buttonClue');
+setClueButtonWord('ButtonClue1');
/****
* Functions
****/
function updateScoreTest(nouveauScore) {
@@ -525,8 +545,44 @@
clueButton.x = game.width - clueButton.width; // Adjust x position after initialization
clueButton.y = clueButton.height / 2; // 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() {
+ if (!wordGrid.isEmpty()) {
+ //Si le joueur a déjà commencé à former un mot, on ne donne pas d'indice
+ return;
+ }
+ //On change la couleur des lettres d'un des mots au hasard de mainGrid.words
+ if (mainGrid.words.length >= 1) {
+ var randomIndex = Math.floor(Math.random() * mainGrid.words.length);
+ var word = mainGrid.words[randomIndex];
+ mainGrid.colorWordCells(word, "#FF5500");
+ LK.setTimeout(function () {
+ mainGrid.colorWordCells(word, "#000000");
+ }, 3000);
+ }
+} //Fin de la fonction onClickClueButtonWord
+//Fonction setClueButton1 : permet de définir le bouton d'indice 1
+function setClueButton1(asset) {
+ clue1Button = 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: 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);
+} //Fin de la fonction setClueButton1
//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.