The single biggest reason AI platformers feel bad is the jump. You get gravity, you get a jump impulse, and it's stiff and unforgiving. The magic is all the invisible assists that pro platformers ship.
My old prompt just said "add jumping with gravity." The result had no coyote time, no jump buffering, and instant max-speed movement, so it felt like driving a fridge. I now enumerate every assist with exact frame/millisecond windows and forbid instant velocity changes. The character finally feels alive.
Posting the prompt in case it saves someone the tuning pain.
Build a 2D platformer character controller in a single HTML canvas file, 60fps, no engine. One screen, a few static platforms, a player rectangle. Controls: A/D or arrows to move, Space/W to jump.
Make the jump FEEL good by implementing all of these with the given windows:
1. Coyote time: allow a jump up to 100ms (6 frames) after walking off a ledge.
2. Jump buffering: if Space is pressed up to 120ms before landing, jump immediately on land.
3. Variable jump height: releasing Space early cuts upward velocity by 50% (short hop vs full hop).
4. Asymmetric gravity: rising gravity 2000px/s^2, falling gravity 2600px/s^2 so the arc feels snappy; clamp fall speed at 900px/s.
5. Horizontal accel/decel: reach max run speed (280px/s) over ~90ms, decelerate faster than you accelerate; add a small skid when reversing direction.
6. Apex hang: near the top of the jump (|vy| < 60), reduce gravity 30% for a brief float.
7. Landing squash (0.8 height, 90ms recover) and a small dust puff of 5 particles.
Constraints: fixed-timestep physics with an accumulator, framerate-independent. Expose all tunables as named constants at the top with comments. Do NOT snap velocity instantly on input. Before the code, output a table of every assist and its time window.