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
User prompt
Please fix the bug: 'TypeError: imagesToScrollRescale[i] is undefined' in or related to this line: 'if (imagesToScrollRescale[i].isDestroyedOnEnd) {' Line Number: 725
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -401,9 +401,9 @@
mainGrid.y = MainZone.height / 6;
game.addChild(mainGrid);
initWordGrid();
setValidateButton('buttonValidate');
- setClueButton('buttonClue');
+ setClueButtonFirstLetter('buttonClue');
setClueButtonWord('ButtonClue1');
setClueButtonDrop('ButtonClue2');
} //Fin de la fonction initGameThema
function updateScoreTest(nouveauScore) {
@@ -479,10 +479,10 @@
onClick: onClickValidateButton
});
game.addChild(validateButton);
} //Fin de la fonction setValidateButton
-//Fonction onClickClueButton : permet de donner un indice au joueur
-function onClickClueButton() {
+//Fonction onClickClueButtonLetter : permet de donner un indice au joueur
+function onClickClueButtonLetter() {
if (!wordGrid.isEmpty()) {
//Si le joueur a déjà commencé à former un mot, on ne donne pas d'indice
return;
}
@@ -491,28 +491,43 @@
var word = mainGrid.words[randomIndex];
var firstLetter = word[0];
var line = -1;
var col = -1;
- for (var i = 0; i < mainGrid.gridLines; i++) {
+ var isFound = false;
+ for (var i = 0; i < mainGrid.gridLines && !isFound; i++) {
//On colorie la première lettre du mot pendant 2 secondes
- for (var j = 0; j < mainGrid.gridColumns; j++) {
+ for (var j = 0; j < mainGrid.gridColumns && !isFound; j++) {
if (mainGrid.cells[i][j].letter == firstLetter) {
mainGrid.cells[i][j].setColorToLetter("#FF5500");
line = i;
col = j;
- break;
+ isFound = true;
}
}
}
LK.setTimeout(function () {
if (mainGrid.cells[line] && mainGrid.cells[line][col]) {
mainGrid.cells[line][col].setColorToLetter("#000000");
+ var tableauFrom = [];
+ tableauFrom.push({
+ x: game.width / 2,
+ y: MainZone.y - scoreText.height / 2
+ });
+ createImages('CostCoin', tableauFrom);
+ if (imagesToScrollRescale.length > 0) {
+ imagesToScrollRescale[0].xToReach = clueButton.x;
+ imagesToScrollRescale[0].yToReach = clueButton.y;
+ imagesToScrollRescale[0].valueToAddToScore = -1;
+ imagesToScrollRescale[0].nbTicksLeft = 30;
+ imagesToScrollRescale[0].soundOnEnd = 'SoundCostCoin';
+ imagesToScrollRescale[0].isDestroyedOnEnd = true;
+ }
}
}, 2000);
}
-} //Fin de la fonction onClickClueButton
-//Fonction setClueButton : permet de définir le bouton d'indice
-function setClueButton(asset) {
+} //Fin de la fonction onClickClueButtonLetter
+//Fonction setClueButtonFirstLetter : permet de définir le bouton d'indice
+function setClueButtonFirstLetter(asset) {
clueButton = new Button('', {
assetName: asset,
x: game.width / 2 - 350,
y: 150,
@@ -523,14 +538,14 @@
text: {
size: 50,
fill: "#000000"
},
- onClick: onClickClueButton
+ onClick: onClickClueButtonLetter
});
clueButton.x = game.width - clueButton.width; // Adjust x position after initialization
clueButton.y = mainGrid.y + clueButton.height; // Adjust y position after initialization
game.addChild(clueButton);
-} //Fin de la fonction setClueButton
+} //Fin de la fonction setClueButtonFirstLetter
//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
@@ -695,26 +710,27 @@
return isWordValid;
} //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] : {};
// Création d'une nouvelle instance de l'image asset
var assetToScrollRescale = LK.getAsset(asset, {
- anchorX: 0.5,
- anchorY: 0.5,
- scaleX: 1,
- scaleY: 1,
- x: xFrom,
- y: yFrom
+ anchorX: 0.5 || options.anchorX,
+ anchorY: 0.5 || options.anchorY,
+ scaleX: 1 || options.scaleX,
+ scaleY: 1 || options.scaleY,
+ x: xFrom || options.xFrom,
+ y: yFrom || options.yFrom
});
var imageToScrollRescale = {
- animate: false,
- image: assetToScrollRescale,
- xToReach: 0,
- yToReach: 0,
- scaleToReach: 1,
- nbTicksLeft: 0,
- isDestroyedOnEnd: false,
- valueToAddToScore: 0
+ animate: false || options.animate,
+ image: assetToScrollRescale || options.image,
+ xToReach: 0 || options.xToReach,
+ yToReach: 0 || options.yToReach,
+ scaleToReach: 1 || options.scaleToReach,
+ nbTicksLeft: 0 || options.nbTicksLeft,
+ isDestroyedOnEnd: false || options.isDestroyedOnEnd,
+ valueToAddToScore: 0 || options.valueToAddToScore
};
game.addChild(assetToScrollRescale);
return imageToScrollRescale;
} //fin createImageToSrollRescale
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.