Code edit (15 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: opponents[(line - 1)] is undefined' in or related to this line: 'if (!opponents[line - 1].finishPosition && opponents[line - 1].x > finishLine.x) {' Line Number: 897
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in victoryAnim, clamp the rotations
Code edit (15 edits merged)
Please save this source code
User prompt
implement the victoryAnim
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: opponents[0] is undefined' in or related to this line: 'opponents[0].update();' Line Number: 706
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 (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'var distance = obstacles[self.lineIndex][0].x - nextX;' Line Number: 173
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'var distance = obstacles[self.lineIndex][0].x - nextX;' Line Number: 171
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (22 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: deltaSpeed is not defined' in or related to this line: 'if (distance > 0 && distance <= 250) {' Line Number: 164
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: 'Script error.' in or related to this line: 'globalSpeedPerLine[line] = globalBaseSpeed;' Line Number: 621
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (!obstacles[line].length && !finishLine.isCut) {' Line Number: 836
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -252,8 +252,11 @@
}
}
};
self.runAnim = function () {
+ if (self.lineIndex == 1) {
+ log("Check finish for #3 at x=" + opponents[line - 1].x + " vs " + (finishLine.x + 512));
+ }
var ocsilDelay = 5;
var armsAmplitude = 0.5;
var legsAmplitude = 0.5;
// Simulate running by continuously balancing the arms and legs
@@ -272,8 +275,11 @@
self.trunk.width = 30 - 10 * (runningArmAngle * Math.PI * 0.5);
self.head.width = 50 - 10 * (runningArmAngle * Math.PI * 0.5);
};
self.jumpAnim = function () {
+ if (self.lineIndex == 1) {
+ log("Check finish for #3 at x=" + opponents[line - 1].x + " vs " + (finishLine.x + 512));
+ }
var ocsilDelay = 50;
var armsAmplitude = 1;
// Simulate running by continuously balancing the arms and legs
var runningArmAngle = Math.sin(LK.ticks / ocsilDelay) * armsAmplitude; // Oscillate arm angle to simulate running faster
@@ -304,8 +310,11 @@
self.leftArm.height -= 35 * rotationSpeed;
}
};
self.fallAnim = function () {
+ if (self.lineIndex == 1) {
+ log("Check finish for #3 at x=" + opponents[line - 1].x + " vs " + (finishLine.x + 512));
+ }
var fallSpeed = 0.1; // Speed of fall animation
// Adjust body parts to simulate falling
self.trunk.rotation += (Math.PI / 2 - self.trunk.rotation) * fallSpeed;
self.rightArm.rotation += (Math.PI / 2 - self.rightArm.rotation) * fallSpeed;
@@ -313,8 +322,11 @@
self.rightLeg.rotation += (Math.PI / 2 - self.rightLeg.rotation) * fallSpeed;
self.leftLeg.rotation += (Math.PI / 2 - self.leftLeg.rotation) * fallSpeed;
};
self.victoryAnim = function () {
+ if (self.lineIndex == 1) {
+ log("Check finish for #3 at x=" + opponents[line - 1].x + " vs " + (finishLine.x + 512));
+ }
var jumpHeight = 10;
var waveSpeed = 0.1;
var armWaveAmplitude = 0.5;
// Make the athlete do little jumps
@@ -473,12 +485,12 @@
/****
* Game Code
****/
+// Enumeration for game states
/****************************************************************************************** */
/************************************** GLOBAL VARIABLES ********************************** */
/****************************************************************************************** */
-// Enumeration for game states
var GAME_STATE = {
INIT: 'INIT',
MENU: 'MENU',
HELP: 'HELP',
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.