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
@@ -74,8 +74,9 @@
var self = Container.call(this);
self.gridColumns = columns;
self.gridLines = lines;
var oneCell = new GridCell('', assetName); //Taille de reference
+ self.oneCell = oneCell;
self.width = oneCell.width * self.gridColumns;
self.height = oneCell.height + oneCell.height * (self.gridLines - 1);
self.clickable = true; //Indique si la grille est cliquable
self.cells = [];
@@ -413,34 +414,59 @@
****/
//Fonction displayminiBackGrounds : permet d'afficher les miniatures des fonds et d'y associer un événement de click
//Les assets de fond sont stockés dans la liste backGroundsList
function displayminiBackGrounds() {
+ var _this = this;
var nbBoutons = backGroundsList.length;
+ var _loop = function _loop() {
+ name = namesList[i];
+ miniBackGrounds[i] = new Button('', {
+ assetName: backGroundsList[i],
+ mainList: mainListsList[i],
+ x: game.width / 2,
+ y: ScoreZone.height + _this.height / 2 + i * (MainZone.height - _this.height / 2) / nbBoutons,
+ width: game.width,
+ height: (MainZone.height - _this.height / 2) / nbBoutons,
+ fill: "#00FF00",
+ text: {
+ size: 100,
+ fill: "#000000"
+ },
+ onClick: onClickMiniBackGround
+ });
+ oneCell = new GridCell('', 'cell'); // Define oneCell variable
+ nbWords = mainListsList[i].length;
+ nameGrid = makeNameGrid(name + "(" + nbWords + ")", 'cellWord');
+ nameGrid.y = miniBackGrounds[i].height / 2 - 2.5 * nameGrid.height;
+ nameGrid.width = miniBackGrounds[i].width - 2 * oneCell.width;
+ nameGrid.height = 2 * miniBackGrounds[i].height;
+ nameGrid.x = -nameGrid.width / 2 + oneCell.width / 2;
+ miniBackGrounds[i].addChild(nameGrid);
+ game.addChild(miniBackGrounds[i]);
+ function setHelpButtons(asset) {
+ helpButton = new Button('', {
+ assetName: asset,
+ x: game.width - 300,
+ y: 100,
+ width: 200,
+ height: 200,
+ fill: "#00FF00",
+ text: {
+ size: 50,
+ fill: "#000000"
+ },
+ onClick: onClickHelpButton
+ });
+ game.addChild(helpButton);
+ }
+ setHelpButtons('ButtonHelp');
+ },
+ name,
+ oneCell,
+ nbWords,
+ nameGrid;
for (var i = 0; i < backGroundsList.length; i++) {
- var name = namesList[i];
- miniBackGrounds[i] = new Button('', {
- assetName: backGroundsList[i],
- mainList: mainListsList[i],
- x: game.width / 2,
- y: ScoreZone.height + this.height / 2 + i * (MainZone.height - this.height / 2) / nbBoutons,
- width: game.width,
- height: (MainZone.height - this.height / 2) / nbBoutons,
- fill: "#00FF00",
- text: {
- size: 100,
- fill: "#000000"
- },
- onClick: onClickMiniBackGround
- });
- var oneCell = new GridCell('', 'cell'); // Define oneCell variable
- var nbWords = mainListsList[i].length;
- var nameGrid = makeNameGrid(name + "(" + nbWords + ")", 'cellWord');
- nameGrid.y = miniBackGrounds[i].height / 2 - 2.5 * nameGrid.height;
- nameGrid.width = miniBackGrounds[i].width - 2 * oneCell.width;
- nameGrid.height = 2 * miniBackGrounds[i].height;
- nameGrid.x = -nameGrid.width / 2 + oneCell.width / 2;
- miniBackGrounds[i].addChild(nameGrid);
- game.addChild(miniBackGrounds[i]);
+ _loop();
}
} //Fin de la fonction displayminiBackGrounds
//Fonction onClickMiniBackGround : permet de sélectionner un thème de jeu
function onClickMiniBackGround() {
@@ -509,8 +535,30 @@
height: MainZone.height
});
game.addChild(backGroundImage);
} //Fin de la fonction setBackGroundImage
+//Fonction setHelpButton : permet de définir le bouton d'aide
+//Le bouton d'aide est situé en haut à droite de l'écran dans la zone score a cote du bouton home
+function setHelpButton(asset) {
+ helpButton = new Button('', {
+ assetName: asset,
+ x: game.width - 300,
+ y: 100,
+ width: 200,
+ height: 200,
+ fill: "#00FF00",
+ text: {
+ size: 50,
+ fill: "#000000"
+ },
+ onClick: onClickHelpButton
+ });
+ game.addChild(helpButton);
+} //Fin de la fonction setHelpButton
+//Fonction onClickHelpButton : permet d'afficher une aide
+function onClickHelpButton() {
+ //On affiche une aide a implementer
+} //Fin de la fonction onClickHelpButton
//Fonction onClickHomeButton : permet de retourner à l'accueil
//On réinitialise les variables et on affiche les miniatures des fonds
function onClickHomeButton() {
isGameStarted = false;
@@ -563,12 +611,13 @@
if (isWordInMainList) {
//Si le mot est dans la liste principale, on compense les lettres utilisées avec récompense
for (var i = 0; i < wordGrid.gridColumns; i++) {
mainGrid.setLetter(wordGrid.cells[0][i].columnFrom, wordGrid.cells[0][i].lineFrom, wordGrid.cells[0][i].letter);
- var xAbsCell = (wordGrid.cells[0][i].columnFrom + 1) * wordGrid.cells[0][i].width + mainGrid.x + wordGrid.cells[0][i].width;
- var yAbsCell = (wordGrid.cells[0][i].lineFrom + 1) * wordGrid.cells[0][i].height + mainGrid.y + wordGrid.cells[0][i].height;
- scoreTest += "i=" + i + " / width: " + wordGrid.cells[0][i].width + " / height: " + wordGrid.cells[0][i].height + " xAbsCell: " + xAbsCell + " / yAbsCell: " + yAbsCell + "\n";
- scrollCoins(1, 'RewardsCoin', xAbsCell, yAbsCell, 5000, 30, rewardForLetter, 'SoundRewardCoin', game.width / 2, MainZone.y - scoreText.height / 2);
+ var cellWidth = mainGrid.oneCell.width;
+ var cellHeight = mainGrid.oneCell.height;
+ var xAbsCell = (wordGrid.cells[0][i].columnFrom + 1) * cellWidth + mainGrid.x - cellWidth;
+ var yAbsCell = (wordGrid.cells[0][i].lineFrom + 1) * cellHeight + mainGrid.y - cellHeight / 2;
+ scrollCoins(1, 'RewardsCoin', xAbsCell, yAbsCell, 60, 30, rewardForLetter, 'SoundRewardCoin', game.width / 2, MainZone.y - scoreText.height / 2);
}
isWordInMainList = false;
}
wordGrid.resetGrid();
@@ -966,9 +1015,9 @@
/****
* Main loop
****/
game.update = function () {
- //scoreTest = wordsMainList.length;
+ scoreTest = wordsMainList.length;
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.