Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: imageBackGround is not defined' in or related to this line: 'var backGround = imageBackGround;' Line Number: 484
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: this.children[e].setStageReference is not a function' in or related to this line: 'game.update = function () {' Line Number: 1100
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: object.addChild is not a function' in or related to this line: 'object.addChild(nameGrid);' Line Number: 620
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: object.addChild is not a function' in or related to this line: 'object.addChild(nameGrid);' Line Number: 618
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: t is undefined' in or related to this line: 'backGroundImage = LK.getAsset(image, {' Line Number: 539
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 (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'var nbWords = mainListsList[i].length;' Line Number: 468
Code edit (19 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'var nbWords = mainListsList[i].length;' Line Number: 468
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'resetGrid')' in or related to this line: 'mainGrid.resetGrid();' Line Number: 592
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: setHelpButtons is not defined' in or related to this line: 'setHelpButtons('ButtonHelp');' Line Number: 471
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -319,9 +319,9 @@
var namesList = ["PLANETES AND SATELLITES", "USA STATES", "EUROPEAN CAPITALES", "ANIMALS", "PERIODIC TABLE OF THE ELEMENTS", "VIDEO GAMES"]; //Liste des thèmes de jeu
var backGroundsList = ["BackGroundPlanetesNSatellites", "BackGroundUSAStates", "BackGroundEuropeanCapitales", "BackGroundAnimals", "BackGroundPeriodic", "BackGroundGames"]; //Liste des assets de fond
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 europeanCapitales = ["AMSTERDAM", "ANDORRA-LA-VELLA", "ANKARA", "ATHENS", "BELGRADE", "BERLIN", "BERN", "ANKA", "BERA"];
+var europeanCapitales = ["AMSTERDAM", "ANDORRA-LA-VELLA", "ANKARA", "ATHENS", "BELGRADE", "BERLIN", "BERN", "ANKA", "BERA", "ANRA"];
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 animals = ["AARDVARK", "ALBATROSS", "ALLIGATOR", "ALPACA", "ANT", "ANTEATER", "ANTELOPE", "APE", "ARMADILLO", "BABOON", "BADGER", "BAT", "BEAR", "BEAVER", "BEE", "BEETLE", "BISON", "BOAR", "BUFFALO", "BUTTERFLY", "CAMEL", "CANARY", "CAPYBARA", "CARIBOU", "CARP", "CAT", "CATERPILLAR", "CHEETAH", "CHICKEN", "CHIMPANZEE", "CHINCHILLA", "CHOUGH", "CLAM", "COBRA", "COCKROACH", "COD", "CORMORANT", "COYOTE", "CRAB", "CRANE", "CROCODILE", "CROW", "CURLEW", "DEER", "DINOSAUR", "DOG", "DOGFISH", "DOLPHIN", "DONKEY", "DOTTEREL", "DOVE", "DRAGONFLY", "DUCK", "DUGONG", "DUNLIN", "EAGLE", "ECHIDNA", "EEL", "ELAND", "ELEPHANT", "ELK", "EMU", "FALCON", "FERRET", "FINCH", "FISH", "FLAMINGO", "FLY", "FOX", "FROG", "GAUR", "GAZELLE", "GERBIL", "GIRAFFE", "GNAT", "GNU", "GOAT", "GOLDFINCH", "GOLDFISH", "GOOSE", "GORILLA", "GOSHAWK", "GRASSHOPPER", "GROUSE", "GUANACO", "GULL", "HAMSTER", "HARE", "HAWK", "HEDGEHOG", "HERON", "HERRING", "HIPPOPOTAMUS", "HORNET", "HORSE", "HUMMINGBIRD", "HYENA", "IBEX", "IBIS", "JACKAL", "JAGUAR", "JAY", "JELLYFISH", "KANGAROO", "KINGFISHER", "KOALA", "KOOKABURA", "KUDU", "LAPWING", "LARK", "LEMUR", "LEOPARD", "LION", "LLAMA", "LOBSTER", "LOCUST", "LORIS", "LOUSE", "LYREBIRD", "MAGPIE", "MALLARD", "MANATEE", "MANDRILL", "MANTIS", "MARTEN", "MEERKAT", "MINK", "MOLE", "MONKEY", "MOOSE", "MOSQUITO", "MOUSE", "MULE", "NARWHAL", "NEWT", "NIGHTINGALE", "OCTOPUS", "OKAPI", "OPOSSUM", "ORYX", "OSTRICH", "OTTER", "OWL", "OYSTER", "PANTHER", "PARROT", "PARTRIDGE", "PEAFOWL", "PELICAN", "PENGUIN", "PHEASANT", "PIG", "PIGEON", "PORCUPINE", "PORPOISE", "QUAIL", "QUELEA", "QUETZAL", "RABBIT", "RACCOON", "RAIL", "RAM", "RAT", "RAVEN", "REINDEER", "RHINOCEROS", "ROOK", "SALAMANDER", "SALMON", "SANDPIPER", "SARDINE", "SCORPION", "SEAHORSE", "SEAL", "SHARK", "SHEEP", "SHREW", "SKUNK", "SNAIL", "SNAKE", "SPARROW", "SPIDER", "SPOONBILL", "SQUID", "SQUIRREL", "STARLING", "STINGRAY", "STINKBUG", "STORK", "SWALLOW", "SWAN", "TAPIR", "TARSIER", "TERMITE", "TIGER", "TERN", "THRUSH", "TIGER", "TOAD", "TOUCAN", "TROUT", "TURKEY", "TURTLE", "VIPER", "VULTURE", "WALLABY", "WALRUS", "WASP", "WEASEL", "WHALE", "WILDCAT", "WOLF", "WOMBAT", "WOODCOCK", "WOODPECKER", "WORM", "WREN", "YAK", "ZEBRA"];
var periodic = ["HYDROGEN", "HELIUM", "LITHIUM", "BERYLLIUM", "BORON", "CARBON", "NITROGEN", "OXYGEN", "FLUORINE", "NEON", "SODIUM", "MAGNESIUM", "ALUMINIUM", "SILICON", "PHOSPHORUS", "SULFUR", "CHLORINE", "ARGON", "POTASSIUM", "CALCIUM", "SCANDIUM", "TITANIUM", "VANADIUM", "CHROMIUM", "MANGANESE", "IRON", "COBALT", "NICKEL", "COPPER", "ZINC", "GALLIUM", "GERMANIUM", "ARSENIC", "SELENIUM", "BROMINE", "KRYPTON", "RUBIDIUM", "STRONTIUM", "YTTRIUM", "ZIRCONIUM", "NIOBIUM", "MOLYBDENUM", "TECHNETIUM", "RUTHENIUM", "RHODIUM", "PALLADIUM", "SILVER", "CADMIUM", "INDIUM", "TIN", "ANTIMONY", "TELLURIUM", "IODINE", "XENON", "CESIUM", "BARIUM", "LANTHANUM", "CERIUM", "PRASEODYMIUM", "NEODYMIUM", "PROMETHIUM", "SAMARIUM", "EUROPIUM", "GADOLINIUM", "TERBIUM", "DYSPROSIUM", "HOLMIUM", "ERBIUM", "THULIUM", "YTTERBIUM", "LUTETIUM", "HAFNIUM", "TANTALUM", "TUNGSTEN", "RHENIUM", "OSMIUM", "IRIDIUM", "PLATINUM", "GOLD", "MERCURY", "THALLIUM", "LEAD", "BISMUTH", "POLONIUM", "ASTATINE", "RADON", "FRANCIUM", "RADIUM", "ACTINIUM", "THORIUM", "PROTACTINIUM", "URANIUM", "NEPTUNIUM", "PLUTONIUM", "AMERICIUM", "CURIUM", "BERKELIUM", "CALIFORNIUM", "EINSTEINIUM", "FERMIUM", "MENDELEVIUM", "NOBELIUM", "LAWRENCIUM", "RUTHERFORDIUM", "DUBNIUM", "SEABORGIUM", "BOHRIUM", "HASSIUM", "MEITNERIUM", "DARMSTADTIUM", "ROENTGENIUM", "COPERNICIUM", "NIHONIUM", "FLEROVIUM", "MOSCOVIUM", "LIVERMORIUM", "TENNESSINE", "OGANESSON"];
var videogames = ["FINAL-FANTASY", "THE-ELDER-SCROLLS", "WORLD-OF-WARCRAFT", "GUILD-WARS", "STAR-WARS", "BLACK-DESERT", "EVE", "RIFT", "TERA", "NEVERWINTER", "STAR-TREK", "LOTRO", "DC-UNIVERSE", "BLADE&SOUL", "ALBION", "RUNESCAPE", "SKYFORGE", "MAPLESTORY", "AION", "ARCHAGE", "VINDICTUS", "WARFRAME", "THE-SECRET-WORLD", "PLANETSIDE-2", "DUNGEONS&DRAGONS", "STARCRAFT", "DIABLO", "MINECRAFT"];
@@ -329,9 +329,9 @@
var wordsMainList = []; // Initialize wordsMainList to an empty array
var miniBackGrounds = [];
var scoreTest = 0; // Define scoreTest variable
var isScoreUpdatable = false; // Autorise ou pas la mise à jour du score
-var score = 50;
+var score = 100;
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
@@ -383,9 +383,9 @@
});
LK.gui.topLeft.addChild(scoreTestText);
var scoreText = new Text2(score, {
size: 100,
- fill: "#00ff00",
+ fill: "#554444",
anchorX: 0.5,
anchorY: 0
});
//LK.gui.top.addChild(scoreText);
@@ -394,8 +394,9 @@
****/
var policeSize = 128;
var mainGrid = null;
var wordGrid = null;
+var wordGridWords = []; //Liste des mots deja formés
var isGameStarted = false; //Indique si le jeu a commencé dans un thème
var isThemaSelected = false; //Indique si un thème a été sélectionné
var isMGRefillrequired = false; //Indique si le remplissage de la grille principale est nécessaire
var isWordValid = false; //Indique si le mot formé est valide
@@ -533,10 +534,13 @@
} //Fin de la fonction setHelpButton
//Fonction onClickHelpButton : permet d'afficher une aide
//Affiche le backGround de l'aide et le texte d'aide avec displayText
function onClickHelpButton() {
- setBackGroundImage('BackGroundHelp', MainZone.x, MainZone.y, MainZone.width, MainZone.height);
- displayText("-COOL QUIZZ-\nChoose a thema\nGuess the names\n\nBUTTONS:\nHelp displays this\nHome changes thema (keep score)\n\nCLUE BUTTONS (not free):\n-hightlights the first letter\n-hightlights a name\n-gives the letters\n\nHave fun !!", 'cellWord', MainZone.y + MainZone.height / 4);
+ //On cache les miniatures des fonds
+ //for (var i = 0; i < miniBackGrounds.length; i++) {
+ // game.removeChild(miniBackGrounds[i]);
+ //setBackGroundImage('BackGroundHelp', MainZone.x, MainZone.y, MainZone.width, MainZone.height);
+ displayText("-COOL QUIZZ-\nChoose a thema\nGuess the names\n\nBUTTONS:\nHelp: displays this\nHome: changes thema (keep score)\n\nCLUE BUTTONS (not free):\n-hightlights the first letter\n-hightlights a name\n-gives the letters\n\nHave fun !!", 'cellWord', MainZone.y + MainZone.height / 4);
game.removeChild(helpButton);
setHomeButton('ButtonHome');
} //Fin de la fonction onClickHelpButton
//Fonction displayText : permet d'afficher un texte en utilisant des NameGrid
@@ -888,26 +892,21 @@
} //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 = wordGrid.firstWord();
- var count = wordGrid.words.filter(function (element) {
+ var count = liste.filter(function (element) {
return element === word;
}).length;
- scoreTest = "Count:" + count;
if (liste.includes(word)) {
- wordGrid.addWord(word); //Archive les mots trouves
+ wordGridWords.push(word);
mainGrid.removeWord(word); //Retire le mot de la grille principale
- if (count > 1) {
- isWordAlreadyFound = true;
- isWordValid = false;
- }
isWordValid = true;
} else if (wordsMainList.includes(word)) {
isWordValid = true;
isWordInMainList = true;
- wordGrid.addWord(word); //Archive les mots trouves
+ wordGridWords.push(word);
wordsMainList.splice(wordsMainList.indexOf(word), 1); //Retire le mot de la liste principale
- } else if (wordGrid.words.includes(word)) {
+ } else if (wordGridWords.includes(word)) {
isWordAlreadyFound = true;
isWordValid = false;
} else {
isWordValid = false;
@@ -917,9 +916,8 @@
} //Fin de la fonction validateWord
// Fonction pour créer une image à faire défiler et redimensionner
function createImageToSrollRescale(asset, xFrom, yFrom) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- //var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
// Création d'une nouvelle instance de l'image asset
var assetToScrollRescale = LK.getAsset(asset, {
anchorX: 0.5,
anchorY: 0.5,
@@ -1043,8 +1041,9 @@
* Main loop
****/
game.update = function () {
//scoreTest = wordsMainList.length;
+ scoreTest = "Game is started: " + isGameStarted;
updateScoreTest(scoreTest);
//Choix du thème
if (!isThemaSelected) {
return;
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.