Code edit (1 edits merged)
Please save this source code
User prompt
the hold duration should be correlated to the jump's height. the longer the finger is held, the higher the character should jump
User prompt
the player should not jump while the finger is pressed, instead it should only jump after the tap is released. So holding the finger on the screen should charge up the jump, and based on this duration, after releasing the finger, the jump isexecuted
Initial prompt
Hold to jump higher - no enemy
===================================================================
--- original.js
+++ change.js
@@ -18,9 +18,9 @@
self.jumpCharge = Math.min(20, LK.ticks - self.jumpStartTime);
} else {
self.velocityY += 1; // Gravity
if (self.jumpCharge > 0) {
- self.velocityY = -self.jumpCharge * 2; // Multiply the jump charge by 2 to increase the jump height
+ self.velocityY = -self.jumpCharge * 10; // Multiply the jump charge by 2 to increase the jump height
self.jumpCharge = 0;
}
}
self.y += self.velocityY;
pixelated 8-bit cute sitting frog seen from the front. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelated 8-bit cute jumping frog seen from the front. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
background of a pond in the middle of the nature. pixelated 8-bit. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.