AI Game Dev

Variable jump height in a Phaser platformer: tap to hop, hold to jump high

Tap for a small hop, hold for a full jump. Claude Code checked the variable jump height in our Phaser platformer against a skill, measured it in the browser and left it as it was.

Tested with Phaser 3.80.1 · Claude Code 2.1.311

A zoomed frame from the platformer with two jumps from the same spot. A low blue arc is labeled Tap 41 px, a higher yellow arc is labeled Hold 107 px, and the orange square sits at the top of the held jump.

Before you start

  • The platformer from the double jump tutorial, or any Phaser platformer of your own.
  • Claude Code, started in the game's folder.
  • The skill at the end of this page, in the folder's .claude/skills/platformer-feel/. Then type the prompt below.
What we asked“I want a quick tap to give a small hop and holding jump to give a full jump. Check how it works now and fix it if needed. Test it.”

What happened

You
I want a quick tap to give a small hop and holding jump to give a full jump. Check how it works now and fix it if needed. Test it.
  • Used the platformer-feel skill
  • Read the skill's notes on variable jump and testing
  • Read index.html
Claude
The game already has variable jump height in the code (JUMP_CUT = 0.45, applied once on release while rising). Reading the code isn't enough, so I'll measure it in the running game.
  • Checked that Playwright and Chromium are installed
  • Wrote a test outside the project: tap, hold and double jump
  • Ran it with JUMP_CUT at 0.45 and at 1
  • First numbers were uneven (full jump 90px)
  • Checked the game clock: about 46 fps, real time
Claude
The clock is fine. The likely cause is the delay of each Playwright round-trip. I'll record every frame inside the page instead, so the peaks and release times are exact.
  • Recorded every frame inside the page
  • Measured: full jump 107px, 50 ms tap 47px, 100 ms tap 69px
  • With JUMP_CUT = 1: 107px for all three
  • Logged the double jump frame by frame
Claude
I didn't change any code. Tap for a small hop and hold for a full jump already work, and the tests confirm it. When you let go of jump while still rising, the upward speed is multiplied by JUMP_CUT = 0.45. This happens once per jump and does nothing once you're already falling. Double jumps follow the same rule. A held jump reaches 107px and a 50 ms tap 47px, which is 44% of a full jump, inside the usual 35–50% target. With the feature off (JUMP_CUT = 1) taps and holds both reach 107px, so the test does catch it. No errors in the browser console. For a smaller hop, lower JUMP_CUT toward 0.35; for a bigger one, raise it toward 0.6. One unrelated thing I noticed: pressing jump just before landing uses up your double jump instead of being saved for a jump on landing. I didn't change this because it's a separate design choice; tell me if you want it fixed.

With variable jump height, a quick tap of the jump button gives a small hop and holding it gives the full jump. In our game, letting go while the player is still rising cuts the upward speed once, so the jump tops out sooner.

The platformer from the double jump tutorial already did this. We asked Claude Code, with the platformer-feel skill, to check it and fix it if needed. It measured the jump in the running game and changed nothing, because the hop was already in the range the skill asks for.

Tap Space for a small hop, hold it for a full jump. Claude didn't change the game, so there's only one version to play. We only added the start screen and loaded Phaser from this site.

We measured it ourselves too: Playwright in headless Chrome, jumping from standing.

JumpPeak height
Tap (button held 0.05 s)41 px in most runs, 35 to 53 px over 26 runs
Hold until falling107 px, every run
Tap with the cut turned off (JUMP_CUT = 1)107 px

The tap height moves in steps because it depends on which frame the release lands on. Claude’s own run happened to get 47 px. Either way, a tap reaches about 40% of a full jump.

The number behind it is JUMP_CUT = 0.45. On release, the upward speed is multiplied by 0.45. The skill’s default is 0.5 and its good range is 0.35 to 0.6, so Claude left it alone. Lower it for a smaller hop, raise it for a bigger one.

Get the skill. It also covers coyote time and jump buffering.

Recorded with a clean Claude Code: no personal skills, plugins or MCP servers, just the skill on this page.

The skill that made it work

It makes Claude measure the jump in the running game instead of trusting the code, and report the numbers.

platformer-feel
  1. Keep every movement number as a named constant at the top of the player code, in seconds and pixels per second (not frames), so the user can tune them.
  2. Add the three core helpers unless the user says not to: coyote time (a short moment to still jump after running off a ledge), jump buffering (a jump pressed just before landing still happens on landing) and variable jump height (tap for a small hop, hold for a full jump). Read each helper's reference file before you build it.
  3. Test with scripted input, not by reading the code. Each helper needs one test that fails without it and passes with it.
  4. When you finish, list each helper with its number and what the test showed, in plain words.

Save it as .claude/skills/platformer-feel/SKILL.md in your project.

Was this useful?