Code edit (2 edits merged)
Please save this source code
User prompt
in checkForCollisions, the setTimeout uses the iterator line, this can cause unwanted behaviour, secrure this part of the code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'opponents[line - 1].isRunning = true;' Line Number: 1217
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: blocker is not defined' in or related to this line: 'if (blocker) {' Line Number: 1111
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'opponents[line - 1].isRunning = true;' Line Number: 1210
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'log("Line " + line + " : opponent " + opponents[line - 1].lineIndex + " Restore after block");' Line Number: 1207
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'opponents[line - 1].isRunning = true;' Line Number: 1203
Code edit (17 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponent is not defined' in or related to this line: 'opponent.restore();' Line Number: 1202
Code edit (1 edits merged)
Please save this source code
Code edit (19 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: currentPosture is not defined' in or related to this line: 'self.y = linesGroundLevels[self.lineIndex] + (currentPosture.name == startingBlockPosture.name ? 150 : 0);' Line Number: 398
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: 'TypeError: obstacles[i][j] is undefined' in or related to this line: 'obstacles[i][j].destroy();' Line Number: 927
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: raceFinishTime is not defined' in or related to this line: 'if (Date.now() - raceFinishTime > 1000) {' Line Number: 726
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self is undefined' in or related to this line: 'self._update_migrated = function () {' Line Number: 1155
User prompt
add an update function in StartingBlocks
===================================================================
--- original.js
+++ change.js
@@ -504,8 +504,13 @@
width: 60,
height: 30,
rotation: Math.PI * 0.5
});
+ self.speedX = globalSpeedPerLine[0];
+ self._update_migrated = function () {
+ self.speedX = globalSpeedPerLine[0];
+ self.x += self.speedX;
+ };
});
/****************************************************************************************** */
/************************************** TRACK CLASS ************************************ */
/****************************************************************************************** */
@@ -537,12 +542,12 @@
/****
* Game Code
****/
+// Enumeration for game states
/****************************************************************************************** */
/************************************** GLOBAL VARIABLES ********************************** */
/****************************************************************************************** */
-// Enumeration for game states
var GAME_STATE = {
INIT: 'INIT',
MENU: 'MENU',
HELP: 'HELP',
@@ -978,8 +983,15 @@
}
}
}
finishLine._update_migrated();
+ for (var i = 0; i <= numberOfOpponents; i++) {
+ startingBlocks[i]._update_migrated();
+ if (startingBlocks[i].x < -512) {
+ game.removeChild(startingBlocks[i]);
+ startingBlocks[i].destroy();
+ }
+ }
}
function updateProgress() {
if (obstacleJustPassed && !finishLine.isCut) {
// Update Progress
@@ -1128,9 +1140,5 @@
// Handle score display logic here
break;
}
});
-gameInitialize();
-var self = void 0;
-self._update_migrated = function () {
- // Update logic for StartingBlocks, if needed
-};
\ No newline at end of file
+gameInitialize();
\ No newline at end of file
Elongated elipse with black top half and white bottom half.
full close and front view of empty stands. retro gaming style
delete
delete
Basquettes à ressort futuriste. vue de profile. Retro gaming style
a blue iron man style armor flying. Retro gaming style
a blue iron man style armor flying horizontally. Retro gaming style
round button with a big "up" arrow icon and a small line under it. UI
A big black horizontal arrow pointing left with centred text 'YOU' in capital letters, painted on an orange floor.. horizontal and pointing left
remove
gold athletics medal with ribbon. retro gaming style
a black oval with a crying smiley face.