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
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: setScore is not defined' in or related to this line: 'setScore(0);' Line Number: 396
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: clueWord is not defined' in or related to this line: 'if (clueWord != '') {' Line Number: 601
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -409,8 +409,12 @@
function updateScoreTest(nouveauScore) {
scoreTestText.setText(nouveauScore);
} //fin updateScoreTest
function updateScore(nouveauScore) {
+ if (nouveauScore < 0) {
+ nouveauScore = 0;
+ score = 0;
+ }
scoreText.setText(nouveauScore);
} //fin updateScore
//Fonction setMainWordsList : permet de définir la liste principale des mots
function setMainWordsList(liste) {
@@ -431,9 +435,28 @@
if (validateWord(mainGrid.words)) {
//On vide la grille des lettres formant le mot final apres x secondes
LK.setTimeout(function () {
var tableauFrom = wordGrid.cellsPositions();
- createImages('RewardsCoin', tableauFrom);
+ for (var i = 0; i < wordGrid.cellsPositions().length; i++) {
+ createImageToSrollRescale('RewardsCoin', tableauFrom[i], {
+ xToReach: game.width / 2,
+ yToReach: MainZone.y - scoreText.height / 2,
+ nbTicksLeft: Math.floor(Math.random() * 30) + 40,
+ valueToAddToScore: 10,
+ soundOnEnd: 'SoundRewardCoin',
+ isDestroyedOnEnd: true,
+ animate: true
+ });
+ }
+ //createImages('RewardsCoin', tableauFrom, {
+ //xToReach: game.width / 2,
+ //yToReach: MainZone.y - scoreText.height / 2,
+ //nbTicksLeft: Math.floor(Math.random() * 30) + 40,
+ //valueToAddToScore: 10,
+ //soundOnEnd: 'SoundRewardCoin',
+ //isDestroyedOnEnd: true,
+ //animate: true
+ //});
wordGrid.resetGrid();
initWordGrid();
}, 1000);
if (mainGrid.isEmpty()) {
@@ -441,14 +464,17 @@
tableauFrom.push({
x: mainGrid.x + mainGrid.width / 2,
y: mainGrid.y + mainGrid.height / 2
});
- createImages('RewardsCoin', tableauFrom);
- if (imagesToScrollRescale.length > 0) {
- imagesToScrollRescale[0].valueToAddToScore = 100; //Bonus for emptying the main grid
- imagesToScrollRescale[0].nbTicksLeft = 30;
- imagesToScrollRescale[0].soundOnEnd = 'SoundEmptyGrid';
- }
+ createImages('RewardsCoin', tableauFrom, {
+ xToReach: game.width / 2,
+ yToReach: MainZone.y - scoreText.height / 2,
+ nbTicksLeft: 30,
+ valueToAddToScore: 100,
+ soundOnEnd: 'SoundEmptyGrid',
+ isDestroyedOnEnd: true,
+ animate: true
+ });
isMGRefillrequired = true;
}
} else {
//Le mot n'est pas valide, on remet les lettres dans la grille principale
@@ -517,9 +543,10 @@
yToReach: clueButton.y,
nbTicksLeft: 30,
valueToAddToScore: -1,
soundOnEnd: 'SoundCostCoin',
- isDestroyedOnEnd: true
+ isDestroyedOnEnd: true,
+ animate: true
});
}
}, 2000);
}
@@ -709,17 +736,18 @@
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] : {};
//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: options.anchorX !== undefined ? options.anchorX : 0.5,
- anchorY: options.anchorY !== undefined ? options.anchorY : 0.5,
- scaleX: options.scaleX !== undefined ? options.scaleX : 1,
- scaleY: options.scaleY !== undefined ? options.scaleY : 1,
- x: options.xFrom !== undefined ? options.x : xFrom || options.xFrom,
- y: options.yFrom !== undefined ? options.y : yFrom || options.yFrom
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 1.0,
+ scaleY: 1.0,
+ x: xFrom,
+ y: yFrom
});
var imageToScrollRescale = {
animate: options.animate !== undefined ? options.animate : false,
image: options.image !== undefined ? options.image : assetToScrollRescale,
@@ -727,13 +755,24 @@
yToReach: options.yToReach !== undefined ? options.yToReach : 0,
scaleToReach: options.scaleToReach !== undefined ? options.scaleToReach : 1.0,
nbTicksLeft: options.nbTicksLeft !== undefined ? options.nbTicksLeft : 0,
isDestroyedOnEnd: options.isDestroyedOnEnd !== undefined ? options.isDestroyedOnEnd : false,
- valueToAddToScore: options.valueToAddToScore !== undefined ? options.valueToAddToScore : 0
+ valueToAddToScore: options.valueToAddToScore !== undefined ? options.valueToAddToScore : 0,
+ soundOnEnd: options.soundOnEnd !== undefined ? options.soundOnEnd : ''
};
game.addChild(assetToScrollRescale);
return imageToScrollRescale;
} //fin createImageToSrollRescale
+//Fonction createImages : permet de créer plusieurs images à scrollrescaler
+//Chaque image est crée à l'emplacement donnée dans le tableauFrom composé de (x, y)
+function createImages(asset, tableauFrom) {
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+ for (var i = 0; i < tableauFrom.length; i++) {
+ var image = createImageToSrollRescale(asset, tableauFrom[i].x, tableauFrom[i].y, options);
+ image.nbTicksLeft = Math.floor(Math.random() * 30) + 40 || options.nbTicksLeft;
+ imagesToScrollRescale.push(image);
+ }
+} //fin createImages
//Fonction scrollRescaleImages permettant de faire défiler et redimensionner des images
function scrollRescaleImages() {
for (var i = 0; i < imagesToScrollRescale.length; i++) {
if (imagesToScrollRescale[i].animate) {
@@ -777,25 +816,8 @@
}
}
}
} //fin scrollRescaleImages
-//Fonction createImages : permet de créer plusieurs images à scrollrescaler
-//Chaque image est crée à l'emplacement donnée dans le tableauFrom composé de (x, y)
-function createImages(asset, tableauFrom, options) {
- scoreTest = "nbTicksLeft=" + options.nbTicksLeft;
- for (var i = 0; i < tableauFrom.length; i++) {
- var image = createImageToSrollRescale(asset, tableauFrom[i].x, tableauFrom[i].y, options);
- //image.xToReach = game.width / 2 || options.xToReach;
- //image.yToReach = MainZone.y - scoreText.height / 2 || options.yToReach;
- //image.scaleToReach = 1.0 || options.scaleToReach;
- //image.nbTicksLeft = Math.floor(Math.random() * 30) + 40 || options.nbTicksLeft;
- //image.animate = true || options.animate;
- //image.isDestroyedOnEnd = true || options.isDestroyedOnEnd;
- //image.soundOnEnd = 'SoundRewardCoin' || options.soundOnEnd;
- //image.valueToAddToScore = 10 || options.valueToAddToScore;
- imagesToScrollRescale.push(image);
- }
-} //fin createImages
/****
* Main loop
****/
game.update = function () {
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.