Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 214
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'if (scoreText) {' Line Number: 169
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 169
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 172
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 178
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 173
User prompt
Please fix the bug: 'ReferenceError: scoreText is not defined' in or related to this line: 'scoreText.setText(nouveauScore);' Line Number: 172
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: startPoints is not defined' in or related to this line: 'var randomIndex = Math.floor(Math.random() * startPoints.length);' Line Number: 86
Code edit (1 edits merged)
Please save this source code
Initial prompt
Coco Monkey
===================================================================
--- original.js
+++ change.js
@@ -104,9 +104,8 @@
parasol.y = 2500;
var coconuts = [];
var score = 0;
var scoreTest = 0;
-var scoreTxt;
/****
* Game zones and backgrounds
****/
var ScoreZone = {
@@ -159,20 +158,22 @@
function updateScoreTest(nouveauScore) {
scoreTestText.setText(nouveauScore);
} //fin updateScoreTest
function updateScore(nouveauScore) {
- if (scoreText) {
- scoreText.setText(nouveauScore);
+ if (nouveauScore < 0) {
+ nouveauScore = 0;
+ score = 0;
}
+ scoreText.setText(nouveauScore);
} //fin updateScore
/****
* Main loop
****/
game.update = function () {
//Mise à jour score
scoreTest = score;
updateScoreTest(scoreTest);
- updateScore(score);
+ //updateScore(score);
//Autres actions à effectuer sans urgence
if (LK.ticks % 60 == 0) {
var newCoconut = new Coconut();
// Choisir aléatoirement un point de départ