Climb (many legs)

The climb of the game cycles for many legs: the claws reach up in turn while the legs pull up in their own alternating sets, looping every 0.8 seconds for as long as a game has the character climbing.

A cartoon person and a dog with arms reaching up in turn, legs pulled in, mid-climb.

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

What it is for

Climb (many legs) is the climb of the nine game cycles, written for the many set: reaching up with the claws in turn and pulling the legs up in alternating sets, the same leg-by-leg gait Scuttle (many legs, in place) uses, turned upward against a surface instead of sideways across the ground.

The principle it shows: secondary action

The walk cycle block, borrowed here to pull the legs up in their alternating sets, is the main action. The claws reaching in turn, on their own separate rhythm, and the small overall lift, are secondary actions layered on top rather than tied to the legs' own stepping.

The program, line by line

settings: h = 540, leg = 0.1
when it starts
  set left arm -20, right arm 20, left arm lift (0.07*h), right arm lift (0.07*h)
  sin wave on left arm · every 0.8 s · amp -26
  sin wave on right arm · every 0.8 s · amp 26 · phase 3.141592653589793
  walk cycle every 0.8 s · arm swing 0 · no bob · roll 0 · stride 12 · give 4 · bend 20
  left leg lift follows (0.02*h*max(0, -sin(2*pi*(local/(0.8) + 0))))
  right leg lift follows (0.02*h*max(0, -sin(2*pi*(local/(0.8) + 0.5))))
  set dy (-0.016*h)
  sin wave on dy · every 0.4 s · amp (-0.006*h)

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

0.02*h*max(0, -sin(2*pi*(local/(0.8) + 0)))

0.02*h*max(0, -sin(2*pi*(local/(0.8) + 0.5)))

Try this

  1. Reach the left claw 40 degrees instead of 26. The climb stretches noticeably further with each reach.

    In the program: wave · amp -26 → -40

  2. Hold the body 30 pixels up instead of the small amount the formula works out on its own. The character climbs noticeably higher up the surface before the loop repeats.

    In the program: set · to.dy "=-0.016*h" → -30

How it differs from Climb and Swim (many legs)

Climb is the same idea pulling hand over hand on a two-legged body rather than reaching with claws. Swim (many legs) is the other cycle written for this body with no foot-planting math, paddling through water rather than climbing.

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, body, arms, legs
4 legs (a dog)yeswhole body, body, front legs, back legs
no legs (the monster with no legs)yeswhole body, body, arms

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