A quarter turn: the small maths behind Stitchfall's gravity
How one tap turns the pull in Stitchfall: gravity as a direction, running along the tangent, jumping against the pull, and the forgiving timings that make it feel fair.

Stitchfall has one trick, turning gravity, and it has to feel the same on all four sides of a room. That turned out to need very little maths, as long as it was the right maths. Here it is.
Gravity is a direction
The game keeps gravity as one arrow, a unit vector that points down, left, up or right. A turn rotates it by a quarter turn:
The rounding matters. Rotating by with floating-point numbers leaves tiny errors, like , and after a few hundred turns they would add up into a slightly tilted world. Rounding snaps the arrow back to an exact direction every time.
Running along the floor, whatever the floor is
If gravity points along , the floor runs along the tangent
which is turned a quarter turn the other way. For ordinary gravity, , so , and running is plain left and right.
The runner’s velocity is split into two numbers: how fast it moves along , and how fast it falls along . Walking only ever changes the first, and gravity only ever changes the second. Then the two are put back together:
where is the speed along the floor and is the fall. That is the whole reason the controls feel the same on a wall: the code never asks which wall it is.
One exception keeps the screen honest. On the ceiling, points left, so the game flips the stick there, and pressing right still moves the runner right on your screen.
Jumping against the pull
A jump sets the fall speed to a negative number, so the runner flies away from the floor. In Stitchfall that is pixels a second, and gravity adds pixels a second, every second. So a full jump rises
and stays in the air for seconds.
Letting go of jump early cuts the rising speed to 48% of a full jump. Height grows with the square of speed, so a quick tap rises only about as high. That one rule gives you both a small hop and a big leap from the same button.
Momentum survives the turn
When you turn gravity in mid-air, the runner’s speed through the room does not change. Only the directions it is measured against change. So a runner falling fast toward the floor, turned to fall toward a wall, keeps that speed and now sweeps sideways across the room. A lot of Stitchfall’s routes come from that: turning while airborne to carry a fall somewhere it could never go on foot.
The drawing of the runner takes 0.23 seconds to swing round to the new floor, so your eye can follow the turn, but the physics has already changed on the first frame.
Forgiving timings
Two small windows make the jumping feel fair. If you press jump a moment before landing, up to 0.13 seconds early, the game remembers and jumps as soon as you touch down. If you run off a ledge and press jump a moment late, up to 0.11 seconds after, the game still lets you jump as if you were on the edge.
Neither shows on screen, and you would only notice them if they were gone. Turns also have a short cooldown of 0.24 seconds, so a nervous double tap does not spin the room twice.
You can feel all of it in Stitchfall, free in your browser.
