Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: clone is not defined' in or related to this line: 'if (clone) {' Line Number: 254
Code edit (11 edits merged)
Please save this source code
User prompt
now use attachObjectRadial instead of attachAssetRadial for walls
User prompt
Add a new class for Wall similar to Detritus
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 (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: player.slideStart is not a function' in or related to this line: 'player.slideStart();' Line Number: 1109
Code edit (1 edits merged)
Please save this source code
User prompt
add a flag to start detecting swipe only after tap
Code edit (15 edits merged)
Please save this source code
User prompt
don't forget to reset startY
User prompt
now for jump action detect a swipe up using down and move events
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Add a new class BoilingLava that emits lava bubbles (circle asset)
User prompt
Play lose sound when touching river
User prompt
Play jump sound when jumping
Code edit (1 edits merged)
Please save this source code
User prompt
add a red flash if fall in the river
Code edit (8 edits merged)
Please save this source code
User prompt
if player fall in the river call gameover
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -638,9 +638,9 @@
if (slideTimer >= SLIDE_DURATION) {
slideEnd();
}
// Adjust player's vertical position when sliding
- self.y = baseY - stepHeight / 4; // Adjust to quarter height when sliding
+ self.y = baseY + 700; //- stepHeight / 4; // Adjust to quarter height when sliding
} else {
self.y = baseY - stepHeight;
}
// Score calculations
@@ -653,9 +653,11 @@
nodeMulti += stopped ? SCORE_STOPPED_FACTOR : speedFactor;
nodeTicks++;
// Adjustments
var stepHeight = ROAD_STEP_HEIGHT_BASE + step * ROAD_STEP_HEIGHT_INCREMENT; // TODO: Better scaling
- self.y = baseY - stepHeight; // TODO: Better scaling
+ if (!sliding) {
+ self.y = baseY - stepHeight; // TODO: Better scaling
+ }
self.scale.set(PLAYER_SCALE_BASE * stepHeight / ROAD_SEGMENT_HEIGHT); // TODO: Better scaling
body.animate(PLAYER_ANIMATION_SPEED_BASE * speedFactor);
multiplierText.setText((stopped ? SCORE_STOPPED_FACTOR : speedFactor).toFixed(1) + 'x');
// Get the current road segment
@@ -687,21 +689,28 @@
if (!gameOver && !jumping && !falling && !sliding) {
sliding = true;
slideTimer = 0;
body.pushAnimation(animationSlide, PLAYER_POSE_TRANSITION);
- // Rotate the entire player container
- self.rotation = Math.PI / 2;
+ body.rotation = -Math.PI / 2;
+ //body.scale.x *= -1;
+ /* Flies
+ // Rotate the body, not the entire player container
+ body.rotation = -Math.PI / 2;
+ // Flip the body horizontally to ensure correct orientation
+ body.scale.x *= -1;
// Play slide sound (if available)
// LK.getSound('slide').play();
+ */
}
}
function slideEnd() {
if (sliding) {
sliding = false;
slideTimer = 0;
body.pushAnimation(stopped ? animationStand : animationRun, PLAYER_POSE_TRANSITION);
- // Restore player's original rotation
- self.rotation = 0;
+ // Restore body's original rotation and scale
+ body.rotation = 0;
+ //body.scale.x *= -1;
}
}
function adjustScore(averageMulti) {
var points = Math.floor(averageMulti * SCORE_SEGMENT_POINTS);
@@ -1079,9 +1088,9 @@
/*
var boilingLava = game.addChild(new BoilingLava());
boilingLava.x = 600;
boilingLava.y = 600;
-*/
+*/
//==============================================================================
// Global events
//==============================================================================
;
@@ -1183,12 +1192,61 @@
FOOT_RIGHT_ROTATION: -sharedAngle - 1.5 * offsetAngle,
FOOT_LEFT_ROTATION: -sharedAngle + 1.5 * offsetAngle
};
}
+/*
function animationSlide(alpha) {
return {
+ BODY_OFFSET: -150,
+ // Lower the body significantly more
+ HEAD_ROTATION: -Math.PI / 3,
+ // Tilt head down more
+ ARM_UPPER_RIGHT_ROTATION: Math.PI * 3 / 4,
+ // Arms more back and up
+ ARM_UPPER_LEFT_ROTATION: Math.PI * 3 / 4,
+ ARM_LOWER_RIGHT_ROTATION: -Math.PI / 4,
+ // Slightly bend arms
+ ARM_LOWER_LEFT_ROTATION: -Math.PI / 4,
+ LEG_UPPER_RIGHT_ROTATION: -Math.PI / 2,
+ // Legs more horizontal
+ LEG_UPPER_LEFT_ROTATION: -Math.PI / 2,
+ LEG_LOWER_RIGHT_ROTATION: Math.PI / 4,
+ // Slight bend in knees
+ LEG_LOWER_LEFT_ROTATION: Math.PI / 4,
+ FOOT_RIGHT_ROTATION: Math.PI / 6,
+ // Feet angled slightly
+ FOOT_LEFT_ROTATION: Math.PI / 6
+ };
+}
+*/
+// On belly head front
+function animationSlide(alpha) {
+ return {
BODY_ROTATION: Math.PI / 2,
// Rotate body 90 degrees
+ BODY_OFFSET: -50,
+ // Adjust body position to align with ground
+ HEAD_ROTATION: -Math.PI / 6,
+ // Slightly tilt head up
+ ARM_UPPER_RIGHT_ROTATION: -Math.PI / 4,
+ // Arms along body
+ ARM_UPPER_LEFT_ROTATION: -Math.PI / 4,
+ ARM_LOWER_RIGHT_ROTATION: -Math.PI / 6,
+ ARM_LOWER_LEFT_ROTATION: -Math.PI / 6,
+ LEG_UPPER_RIGHT_ROTATION: -Math.PI / 8,
+ // Legs slightly bent
+ LEG_UPPER_LEFT_ROTATION: -Math.PI / 8,
+ LEG_LOWER_RIGHT_ROTATION: Math.PI / 6,
+ LEG_LOWER_LEFT_ROTATION: Math.PI / 6,
+ FOOT_RIGHT_ROTATION: 0,
+ FOOT_LEFT_ROTATION: 0
+ };
+}
+/* // super man head back but on belly
+function animationSlide(alpha) {
+ return {
+ BODY_ROTATION: Math.PI / 2,
+ // Rotate body 90 degrees
BODY_OFFSET: -20,
// Adjust body position to align with ground
HEAD_ROTATION: Math.PI / 6,
// Tilt head up slightly
@@ -1206,5 +1264,32 @@
LEG_LOWER_LEFT_ROTATION: Math.PI / 6,
FOOT_RIGHT_ROTATION: 0,
FOOT_LEFT_ROTATION: 0
};
-}
\ No newline at end of file
+}
+*/
+/* // Head ok but Belly & Flying
+function animationSlide(alpha) {
+ return {
+ BODY_ROTATION: -Math.PI / 2,
+ // Rotate body -90 degrees (feet first)
+ BODY_OFFSET: -20,
+ // Adjust body position to align with ground
+ HEAD_ROTATION: -Math.PI / 6,
+ // Tilt head back slightly
+ ARM_UPPER_RIGHT_ROTATION: Math.PI / 4,
+ // Arms slightly raised
+ ARM_UPPER_LEFT_ROTATION: Math.PI / 4,
+ ARM_LOWER_RIGHT_ROTATION: Math.PI / 6,
+ // Elbows slightly bent
+ ARM_LOWER_LEFT_ROTATION: Math.PI / 6,
+ LEG_UPPER_RIGHT_ROTATION: -Math.PI / 8,
+ // Legs slightly raised
+ LEG_UPPER_LEFT_ROTATION: -Math.PI / 8,
+ LEG_LOWER_RIGHT_ROTATION: Math.PI / 6,
+ // Knees slightly bent
+ LEG_LOWER_LEFT_ROTATION: Math.PI / 6,
+ FOOT_RIGHT_ROTATION: 0,
+ FOOT_LEFT_ROTATION: 0
+ };
+}
+*/
\ No newline at end of file
white
circle sliced into many pieces, flat image. 2d, white background, shadowless.
pixel art of a tall, tree. game asset, 2d, white background, shadowless.
pixel art cloud. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
dark space.
flying lava bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a bonus crystal ball with the recycle symbol. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
top view A green round start button empty in the center like a ring.