Jump (in place)

The jump of the nine game cycles, built in named phases (crouch, rise, apex, fall, land, recover) so a game can start it at any point, or hold a character at the top or in the fall for as long as it needs.

A cartoon person and a dog high in the air above the grass, arms spread wide at the top of a jump.

Use it in a cartoonOpen it in the block editorThe pack file (JSON)

What it is for

Jump (in place) is the jump of the nine game cycles, built as a single move with marked phases (crouch, rise, apex, fall, land, recover) rather than one fixed animation. A platformer can play the whole thing from a standing start, or jump straight to one phase with the from setting: 0 the crouch, 1 the spring, 2 the top, 3 the fall, 4 the landing — a game typically plays from 4 the instant a character touches down, however it got there. The hold setting lets a game pause the character at the apex (1) or in the fall (2) instead of finishing the arc, for a jump whose height depends on how long a button is held.

The principle it shows: anticipation

Before the character leaves the ground at all, it bends into a crouch — knees bent about 32 degrees, no spring yet. That crouch is pure anticipation: it tells the eye what is about to happen a beat before it happens, and it is also where the jump stores the energy the spring releases. Everything after the crouch, the push-off, the apex, the fall and the landing, reads as a single clean arc largely because the crouch primed it first.

The program, line by line

settings: h = 540, leg = 0.24, hold = 0, from = 0
when it starts
  show the side view
  if (from <= 0):
    at the same time:
      — 1:
        glide hips 0, left leg 32, right leg 32, left shin 64, right shin 64, left foot 32, right foot 32, torso -10, left arm -45, right arm -45, left forearm 10, right forearm 10, head 6 over 0.14 s (out)
      — 2:
        set dx 0, dy 0
        for 0.14 s:
          dy follows (h*leg/2*(2 - cos(((0 + 32*sin((min(local/0.14, 1))*pi/2)))*pi/180) - cos((((0 + 32*sin((min(local/0.14, 1))*pi/2))) - ((0 + 64*sin((min(local/0.14, 1))*pi/2))))*pi/180)))
          dx follows (-h*leg/2*(sin(((0 + 32*sin((min(local/0.14, 1))*pi/2)))*pi/180) + sin((((0 + 32*sin((min(local/0.14, 1))*pi/2))) - ((0 + 64*sin((min(local/0.14, 1))*pi/2))))*pi/180)))
    set dx (-h*leg/2*(sin((32)*pi/180) + sin(((32) - (64))*pi/180))), dy (h*leg/2*(2 - cos((32)*pi/180) - cos(((32) - (64))*pi/180)))
  if (from <= 1):
    at the same time:
      — 1:
        glide hips 0, left leg 0, right leg 0, left shin 0, right shin 0, left foot 0, right foot 0, torso -2, left arm 70, right arm 70, left forearm 12, right forearm 12, sx 0.97, sy 1.03 over 0.08 s (in)
      — 2:
        set dx 0, dy 0
        for 0.08 s:
          dy follows (h*leg/2*(2 - cos(((32 + -32*pow(min(local/0.08, 1), 2)))*pi/180) - cos((((32 + -32*pow(min(local/0.08, 1), 2))) - ((64 + -64*pow(min(local/0.08, 1), 2))))*pi/180)))
          dx follows (-h*leg/2*(sin(((32 + -32*pow(min(local/0.08, 1), 2)))*pi/180) + sin((((32 + -32*pow(min(local/0.08, 1), 2))) - ((64 + -64*pow(min(local/0.08, 1), 2))))*pi/180)))
    set dx (-h*leg/2*(sin((0)*pi/180) + sin(((0) - (0))*pi/180))), dy (h*leg/2*(2 - cos((0)*pi/180) - cos(((0) - (0))*pi/180)))
    glide left leg 22, right leg 22, left shin 50, right shin 50, left foot 24, right foot 24, hips 0, torso 0, right arm 125, left arm 145, left forearm 14, right forearm 14, head 4, sx 0.962, sy 1.04 over 0.12 s (out)
  if (from <= 2):
    glide left leg 34, right leg 34, left shin 78, right shin 78, left foot 36, right foot 36, right arm 122, left arm 140, left forearm 20, right forearm 20, head 0, sx 1, sy 1 over 0.18 s (smooth)
  if (hold == 1):
    sin wave on left arm · every 0.6 s · amp 4
    sin wave on right arm · every 0.6 s · amp 4 · phase 3.141592653589793
    sin wave on left leg · every 0.6 s · amp 3 · phase 3.141592653589793
    sin wave on right leg · every 0.6 s · amp 3
  else:
    if (from <= 3):
      glide left leg 12, right leg 12, left shin 30, right shin 30, left foot 12, right foot 12, left arm 110, right arm 110, left forearm 26, right forearm 26, head -4, torso 0, sx 1, sy 1 over 0.22 s (in)
    if (hold == 2):
      sin wave on left arm · every 0.5 s · amp 6
      sin wave on right arm · every 0.5 s · amp 6 · phase 3.141592653589793
      sin wave on left leg · every 0.5 s · amp 5 · phase 3.141592653589793
      sin wave on right leg · every 0.5 s · amp 5
    else:
      glide hips 0, left leg 0, right leg 0, left shin 0, right shin 0, left foot 0, right foot 0, left arm 70, right arm 70, left forearm 20, right forearm 20 over 0.06 s (in)
      at the same time:
        — 1:
          glide hips 0, left leg 28, right leg 28, left shin 56, right shin 56, left foot 28, right foot 28, torso -8, left arm 40, right arm 40, left forearm 18, right forearm 18, head 2, sx 1.03, sy 0.97 over 0.12 s (out)
        — 2:
          set dx 0, dy 0
          for 0.12 s:
            dy follows (h*leg/2*(2 - cos(((0 + 28*sin((min(local/0.12, 1))*pi/2)))*pi/180) - cos((((0 + 28*sin((min(local/0.12, 1))*pi/2))) - ((0 + 56*sin((min(local/0.12, 1))*pi/2))))*pi/180)))
            dx follows (-h*leg/2*(sin(((0 + 28*sin((min(local/0.12, 1))*pi/2)))*pi/180) + sin((((0 + 28*sin((min(local/0.12, 1))*pi/2))) - ((0 + 56*sin((min(local/0.12, 1))*pi/2))))*pi/180)))
      set dx (-h*leg/2*(sin((28)*pi/180) + sin(((28) - (56))*pi/180))), dy (h*leg/2*(2 - cos((28)*pi/180) - cos(((28) - (56))*pi/180)))
      at the same time:
        — 1:
          glide hips 0, left leg 0, right leg 0, left shin 0, right shin 0, left foot 0, right foot 0, torso 0, left arm 0, right arm 0, left forearm 0, right forearm 0, head 0, sx 1, sy 1 over 0.16 s (smooth)
        — 2:
          set dx 0, dy 0
          for 0.16 s:
            dy follows (h*leg/2*(2 - cos(((28 + -28*smoothstep(min(local/0.16, 1))))*pi/180) - cos((((28 + -28*smoothstep(min(local/0.16, 1)))) - ((56 + -56*smoothstep(min(local/0.16, 1)))))*pi/180)))
            dx follows (-h*leg/2*(sin(((28 + -28*smoothstep(min(local/0.16, 1))))*pi/180) + sin((((28 + -28*smoothstep(min(local/0.16, 1)))) - ((56 + -56*smoothstep(min(local/0.16, 1)))))*pi/180)))
      set dx (-h*leg/2*(sin((0)*pi/180) + sin(((0) - (0))*pi/180))), dy (h*leg/2*(2 - cos((0)*pi/180) - cos(((0) - (0))*pi/180)))

Written out in full, exactly as the engine prints them:

h*leg/2*(2 - cos(((0 + 32*sin((min(local/0.14, 1))*pi/2)))*pi/180) - cos((((0 + 32*sin((min(local/0.14, 1))*pi/2))) - ((0 + 64*sin((min(local/0.14, 1))*pi/2))))*pi/180))

-h*leg/2*(sin(((0 + 32*sin((min(local/0.14, 1))*pi/2)))*pi/180) + sin((((0 + 32*sin((min(local/0.14, 1))*pi/2))) - ((0 + 64*sin((min(local/0.14, 1))*pi/2))))*pi/180))

-h*leg/2*(sin((32)*pi/180) + sin(((32) - (64))*pi/180))

h*leg/2*(2 - cos((32)*pi/180) - cos(((32) - (64))*pi/180))

h*leg/2*(2 - cos(((32 + -32*pow(min(local/0.08, 1), 2)))*pi/180) - cos((((32 + -32*pow(min(local/0.08, 1), 2))) - ((64 + -64*pow(min(local/0.08, 1), 2))))*pi/180))

-h*leg/2*(sin(((32 + -32*pow(min(local/0.08, 1), 2)))*pi/180) + sin((((32 + -32*pow(min(local/0.08, 1), 2))) - ((64 + -64*pow(min(local/0.08, 1), 2))))*pi/180))

-h*leg/2*(sin((0)*pi/180) + sin(((0) - (0))*pi/180))

h*leg/2*(2 - cos((0)*pi/180) - cos(((0) - (0))*pi/180))

h*leg/2*(2 - cos(((0 + 28*sin((min(local/0.12, 1))*pi/2)))*pi/180) - cos((((0 + 28*sin((min(local/0.12, 1))*pi/2))) - ((0 + 56*sin((min(local/0.12, 1))*pi/2))))*pi/180))

-h*leg/2*(sin(((0 + 28*sin((min(local/0.12, 1))*pi/2)))*pi/180) + sin((((0 + 28*sin((min(local/0.12, 1))*pi/2))) - ((0 + 56*sin((min(local/0.12, 1))*pi/2))))*pi/180))

-h*leg/2*(sin((28)*pi/180) + sin(((28) - (56))*pi/180))

h*leg/2*(2 - cos((28)*pi/180) - cos(((28) - (56))*pi/180))

h*leg/2*(2 - cos(((28 + -28*smoothstep(min(local/0.16, 1))))*pi/180) - cos((((28 + -28*smoothstep(min(local/0.16, 1)))) - ((56 + -56*smoothstep(min(local/0.16, 1)))))*pi/180))

-h*leg/2*(sin(((28 + -28*smoothstep(min(local/0.16, 1))))*pi/180) + sin((((28 + -28*smoothstep(min(local/0.16, 1)))) - ((56 + -56*smoothstep(min(local/0.16, 1)))))*pi/180))

Try this

  1. Hold the jump at the top (hold 1 instead of 0). Once the apex is reached, a small flutter plays on the arms and legs instead of falling, so the character hangs in the air for as long as a game needs, the way a double-jump or a floaty platformer often wants.

    In the program: params.hold 0 → 1

  2. Start the jump from the landing (from 4 instead of 0). The crouch, spring, apex and fall are all skipped; only the touchdown crouch and the stand back up play, for a game that has already handled the fall itself and just needs the landing.

    In the program: params.from 0 → 4

How it differs from Bounce and Fall

Bounce is a continuous, bouncy hop meant to loop on its own; Jump (in place) is one marked arc a game can start, stop and hold at named points, built for a platformer's jump button rather than a performance. Fall is the cycle a game switches to once a character is actually falling, rather than rising through this one's own fall phase.

Works on

Worked out by the build: it plays the move in the engine on each body and checks what moves on screen. Nobody types this table.
BodyMoves?What moves
2 legs (a person)yeswhole body, turns, body, head, arms, legs
4 legs (a dog)yeswhole body, body, head, front legs, back legs, tail, ears
no legs (the monster with no legs)yeswhole body, turns, body, arms, tail, ears

c4c:beh:cycle_jump · version 1.0.0 · c4c-free · by Jabbertoon