Code edit (1 edits merged)
Please save this source code
User prompt
in Athlete class use the line as an index in color array for the tint
Code edit (5 edits merged)
Please save this source code
User prompt
add an array of colors
Code edit (6 edits merged)
Please save this source code
User prompt
In athlete update() if isAi, call jump once when an obstacle of obstaclesLine1 is at a x distance of 300
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: 'ReferenceError: opponent1 is not defined' in or related to this line: 'opponent1.update();' Line Number: 453
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'rightArm')' in or related to this line: 'self.rightArm.rotation = idlePosture.rightArm.r;' Line Number: 236
User prompt
add an opponent1 athlete at x=400, y=groundLevel-200-220
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: runningArmAngle is not defined' in or related to this line: 'log("Posture rightArm.rotation=" + runningArmAngle);' Line Number: 110
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
In jumpAnim replace LK.ticks bt Date.now()
Code edit (1 edits merged)
Please save this source code
User prompt
In jumpAnim add modulos to lehs rotations to ensure values stay consistent
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'athlete.reset();' Line Number: 435
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: 'ReferenceError: isFalling is not defined' in or related to this line: 'obstacleSpawnTicker += isFalling ? 0 : 1;' Line Number: 474
===================================================================
--- original.js
+++ change.js
@@ -126,22 +126,24 @@
self.trunk.rotation = 0.125;
self.runAnim();
} else {
//log("self.leftArm.height", self.leftArm.height);
- self.jumpAnim();
self.y += self.speedY * Math.abs(globalSpeed / 10);
self.speedY += self.gravity * Math.abs(globalSpeed / 10);
var groundY = groundLevel - 200;
if (self.y >= groundY) {
self.y = groundY;
self.isOnGround = true;
+ self.speedY = 0;
}
+ self.jumpAnim();
}
} else {
self.y += 5;
if (self.y >= groundLevel) {
self.y = groundLevel;
self.isOnGround = true;
+ self.speedY = 0;
}
}
self.updatePosture();
};
@@ -224,18 +226,18 @@
self.restore = function () {
log("restore...");
self.x = 400;
self.y = groundLevel - 200;
- self.setPosture(idlePosture);
- self.isFalling = false;
- self.isOnGround = true;
- self.hasFlashed = false;
- self.hasFlashedGround = false;
self.trunk.rotation = 0;
self.rightArm.rotation = 0;
self.leftArm.rotation = 0;
self.rightLeg.rotation = 0;
self.leftLeg.rotation = 0;
+ self.setPosture(idlePosture);
+ self.isFalling = false;
+ self.isOnGround = true;
+ self.hasFlashed = false;
+ self.hasFlashedGround = false;
};
});
/****************************************************************************************** */
/************************************** OBSTACLE CLASS ************************************ */
@@ -450,14 +452,15 @@
/****************************************************************************************** */
/************************************** GAME FUNCTIONS ************************************ */
/****************************************************************************************** */
function updateTracks() {
- if (!(athlete.isFalling && athlete.isOnGround)) {
- track.update();
- track2.update();
- track3.update();
- track4.update();
+ if (!athlete.isFalling || !athlete.isOnGround) {
+ return;
}
+ track.update();
+ track2.update();
+ track3.update();
+ track4.update();
}
function spawnObstacles() {
// Spawn obstacles
obstacleSpawnTicker += athlete.isFalling ? 0 : 1;
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.