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
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: fallSpeed is not defined' in or related to this line: 'self.rightArm.rotation += (Math.PI / 2 - self.rightArm.rotation) * fallSpeed;' Line Number: 245
Code edit (1 edits merged)
Please save this source code
User prompt
add obstaclesLine2
User prompt
add a second line of obstacles
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: track4 is not defined' in or related to this line: 'track4.update();' Line Number: 458
User prompt
make the new tracks move like the previous one
===================================================================
--- original.js
+++ change.js
@@ -221,13 +221,9 @@
self.x = 400;
self.y = groundLevel - 200;
self.speedY = 0;
self.trunk.rotation = 0;
- if (idlePosture && idlePosture.rightArm) {
- self.rightArm.rotation = idlePosture.rightArm.r;
- } else {
- self.rightArm.rotation = 0; // Default rotation if posture is not defined
- }
+ self.rightArm.rotation = idlePosture.rightArm.r;
self.leftArm.rotation = 0;
self.rightLeg.rotation = 0;
self.leftLeg.rotation = 0;
self.setPosture(idlePosture);
@@ -297,13 +293,8 @@
/****
* Game Code
****/
-// Initialize opponent1 athlete
-var opponent1 = game.addChild(new Athlete());
-opponent1.x = 400;
-opponent1.y = groundLevel - 200 - 220;
-opponent1.restore();
/****************************************************************************************** */
/************************************** GLOBAL VARIABLES ********************************** */
/****************************************************************************************** */
// Enumeration for game states
@@ -317,8 +308,9 @@
SCORE: 'SCORE'
};
var gameState = GAME_STATE.INIT;
var athlete;
+var opponent1;
var obstacles = [];
var obstaclesLine2 = [];
var groundLevel = 2732 - 200; // Ground level set 200px from the bottom
var obstacleSpawnTicker = 0;
@@ -421,8 +413,12 @@
track4.y = 2732 - 1024;
// Initialize athlete
athlete = game.addChild(new Athlete());
athlete.restore();
+ // Initialize opponents
+ opponent1 = game.addChild(new Athlete());
+ opponent1.x = 400;
+ opponent1.y = groundLevel - 200 - 220;
gameState = GAME_STATE.PLAYING;
if (isDebug) {
// Debug Marker
debugMarker = LK.getAsset('debugMarker', {
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.