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
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
===================================================================
--- original.js
+++ change.js
@@ -272,8 +272,9 @@
/****
* Game Code
****/
+// 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.
@@ -301,9 +302,8 @@
* 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 backGroundsList = ["BackGroundPlanetesNSatellites", "BackGroundUSAStates", "BackGroundEuropeanCapitales"]; //Liste des assets de fond
var mainListsList = [planetesNsatellites, usaStates, europeanCapitales]; //Liste des listes de mots principales
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"];
@@ -476,9 +476,8 @@
wordGrid.resetGrid();
initWordGrid();
}, 1000);
}
- clueLevel = 0; //On remet le niveau d'indice à 0
} //Fin de la fonction onClickValidateButton
//Fonction setValidateButton : permet de définir le bouton de validation
function setValidateButton(asset) {
validateButton = new Button('', {
@@ -590,38 +589,28 @@
game.addChild(clueButtonWord);
} //Fin de la fonction setClueButtonWord
//Fonction onClickClueButtonDrop : permet de donner un indice au joueur (drop letter)
function onClickClueButtonDrop() {
- if (!wordGrid.isEmpty() && clueLevel == 0) {
- //Si le joueur a déjà commencé à former un mot, on ne donne pas d'indice
- return;
- }
- switch (clueLevel) {
- case 0:
- //On prend un mot au hasard dans la liste principale et on clique sur la première lettre (isClicked = true)
- if (mainGrid.words.length > 0 && wordGrid.isEmpty()) {
- 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 secondLetter = word[1];
- mainGrid.findNclickCell(firstLetter);
- LK.setTimeout(function () {
- mainGrid.findNclickCell(secondLetter);
- 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, costForDrop);
- }
- break;
+ if (wordGrid.isEmpty() && clueWord == '') {
+ //On prend un mot au hasard dans la liste principale et on clique sur les deux premières lettres
+ if (mainGrid.words.length > 0) {
+ 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 secondLetter = word[1];
+ mainGrid.findNclickCell(firstLetter);
+ LK.setTimeout(function () {
+ mainGrid.findNclickCell(secondLetter);
+ scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 2, costForDrop);
+ }, 100);
+ }
+ } else if (!wordGrid.isEmpty() && clueWord != '') {
+ //On descend la suite du mot
+ var letter = clueWord[wordGrid.gridColumns];
+ mainGrid.findNclickCell(letter);
+ scrollCostCoins(clueButtonDrop.x, clueButtonDrop.y, 1, costForDrop);
} //Fin du switch
- clueLevel++;
} //Fin de la fonction onClickClueButtonDrop
//Fonction setClueButtonDrop : permet de définir le bouton d'indice drop letter
function setClueButtonDrop(asset) {
clueButtonDrop = new Button('', {
@@ -871,18 +860,19 @@
} else {
clueButtonWord.visible = true;
}
var notEnoughtMoneyForDrop = longuestWord(mainGrid.words) * costForDrop > score;
- var wordOfGrid = '';
- if (!wordGrid.isEmpty() && wordGrid.words.length > 0) {
- scoreTest = "wordofGrid : " + wordOfGrid;
- wordOfGrid = wordGrid.words[0];
- }
- if (notEnoughtMoneyForDrop || clueWord == '' && !wordGrid.isEmpty() || clueWord.length < wordOfGrid.length) {
+ 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) {
@@ -898,9 +888,8 @@
}
if (indexCellToRemove >= 0) {
wordGrid.removeCell(indexCellToRemove);
indexCellToRemove = -1;
- clueLevel = 0; //On remet le niveau d'indice à 0
}
//Autres actions à effectuer sans urgence
if (LK.ticks % 10 == 0) {
//Chargement initiale de la grille principale si nécessaire (vide):
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.