Swim

The swim of the nine game cycles: the arms paddle in turn, the legs kick and the head stays up, looping every 1.2 seconds for as long as a game has the character in the water.

A cartoon person and a dog with one arm reaching forward, mid-paddle, head held up.

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

What it is for

Swim is the swim of the nine game cycles: a game plays it while a character is in water, paddling in place, looping every 1.2 seconds for as long as the swim lasts. Like Climb, it keeps no foot-planting math at all and never moves sideways on its own: there is no floor to plant against, so a game is left to decide how far the swim actually carries the character.

The principle it shows: overlapping action

The arms paddle on a 1.2-second cycle, but the legs kick twice as fast, every 0.6 seconds, and the small body bob and the tail swing keep that same faster beat. Three different rhythms run at once rather than one shared timing for the whole body, so the swim does not read as a single mechanical stroke; the arms, legs and tail each seem to be doing their own part of the work.

The program, line by line

settings: h = 540, leg = 0.24
when it starts
  show the side view
  set dy (-0.05*h), torso -6, left arm 52, right arm 52, left forearm 44, right forearm 44, left leg 16, right leg 16, left shin 26, right shin 26, left foot -10, right foot -10, head 14
  sin wave on left arm · every 1.2 s · amp 24
  sin wave on right arm · every 1.2 s · amp 24 · phase 3.141592653589793
  sin wave on left forearm · every 1.2 s · amp 30 · phase 1.5707963267948966
  sin wave on right forearm · every 1.2 s · amp 30 · phase 4.71238898038469
  sin wave on left leg · every 0.6 s · amp 16
  sin wave on right leg · every 0.6 s · amp 16 · phase 3.141592653589793
  sin wave on left shin · every 0.6 s · amp 12 · phase 1.2
  sin wave on right shin · every 0.6 s · amp 12 · phase 4.341592653589793
  sin wave on dy · every 0.6 s · amp 4
  sin wave on tail · every 0.6 s · amp 14

Try this

  1. Hold the head 30 degrees up instead of 14. The character strains much further above the water, a harder effort to keep its face clear.

    In the program: set · to.part:head 14 → 30

  2. Kick the legs 30 degrees each way instead of 16. The kick doubles in width, a much harder, splashier stroke.

    In the program: wave · amp 16 → 30

How it differs from Climb and Walk (in place)

Climb is the other cycle with no foot-planting math, pulling hand over hand against a surface rather than paddling through water. Walk (in place) keeps the foot planted on the ground with its own cosine formula throughout the loop; Swim has nothing to plant against, so it drops that mechanism entirely and layers its rhythms instead.

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_swim · version 1.0.0 · c4c-free · by Jabbertoon