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
@@ -280,9 +280,8 @@
/****
* 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.
@@ -310,8 +309,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 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"];
@@ -384,8 +384,9 @@
var wordGrid = null;
var isGameStarted = false;
var isMGRefillrequired = false; //Indique si le remplissage de la grille principale est nécessaire
var isWordValid = false; //Indique si le mot formé est valide
+var isWordInMainList = false; //Indique si le mot formé est dans la liste principale
var validateButton = null;
var clueButtonLetter = null;
var clueButtonWord = null;
var clueButtonDrop = null;
@@ -439,9 +440,10 @@
game.addChild(backGroundImage);
} //Fin de la fonction setBackGroundImage
//Fonction onClickValidateButton : permet de valider le mot formé par le joueur
function onClickValidateButton() {
- if (validateWord(mainGrid.words)) {
+ var isValide = validateWord(mainGrid.words);
+ if (isValide) {
//On vide la grille des lettres formant le mot final apres x secondes
LK.setTimeout(function () {
var tableauFrom = wordGrid.cellsPositions();
for (var i = 0; i < tableauFrom.length; i++) {
@@ -709,17 +711,17 @@
return cellLetter;
} //Fin de la fonction addCellLetterToWord
//Fonction validateWord : permet de valider le mot formé par le joueur dans une liste de mots
function validateWord(liste) {
- var word = '';
- for (var i = 0; i < wordGrid.gridColumns; i++) {
- word += wordGrid.cells[0][i].letter;
- }
+ var word = wordGrid.firstWord();
if (liste.includes(word)) {
wordGrid.addWord(word); //Archive les mots trouves
mainGrid.removeWord(word); //Retire le mot de la grille principale
- //score += word.length * 10;
isWordValid = true;
+ } else if (wordsMainList.includes(word)) {
+ scoreTest = "word in main:" + word;
+ isWordValid = true;
+ isWordInMainList = true;
} else {
isWordValid = false;
}
wordGrid.colorAllCells(isWordValid ? "#00FF00" : "#FF0000");
@@ -759,8 +761,23 @@
var image = createImageToSrollRescale(asset, tableauFrom[i].x, tableauFrom[i].y, options);
imagesToScrollRescale.push(image);
}
} //fin createImages
+//Fonction scrollRewardCoins : permet de faire défiler des pièces de monnaie
+function scrollRewardCoins(nbCoins, valueToAddToScore, xFrom, yFrom) {
+ for (var i = 0; i < nbCoins; i++) {
+ var image = createImageToSrollRescale('RewardsCoin', xFrom, yFrom, {
+ xToReach: game.width / 2,
+ yToReach: MainZone.y - scoreText.height / 2,
+ nbTicksLeft: Math.floor(Math.random() * 30) + 40,
+ valueToAddToScore: valueToAddToScore,
+ soundOnEnd: 'SoundRewardCoin',
+ isDestroyedOnEnd: true,
+ animate: true
+ });
+ imagesToScrollRescale.push(image);
+ }
+} //fin scrollRewardCoins
//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, {
@@ -895,15 +912,18 @@
} else {
clueButtonWord.visible = true;
}
var word = wordGrid.firstWord();
- scoreTest = "firtWord: " + word + " / clueWord: " + clueWord;
var notEnoughtMoneyForDrop = longuestWord(mainGrid.words) * costForDrop > score;
- if (notEnoughtMoneyForDrop || clueWord == '' && !wordGrid.isEmpty()) {
+ if (notEnoughtMoneyForDrop || clueWord == '' && !wordGrid.isEmpty() || word == clueWord && word != '') {
clueButtonDrop.visible = false;
} else {
clueButtonDrop.visible = true;
}
+ if (wordGrid.isEmpty() && clueWord != '') {
+ //On réinitialise les parametres de l'indice drop letter
+ clueWord = '';
+ }
//Autres actions à effectuer sans urgence
if (LK.ticks % 10 == 0) {
//Chargement initiale de la grille principale si nécessaire (vide):
//mot(s) est choisi au hasard dans la liste principale,
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.