Soft Body’s Movement
Here’s a short thing on how I designed Soft Body’s movement. I hope that this is basic enough for most people to get the gist of it. If you have questions, feel free to reach out to me on Twitter (Zeke Virant). Soft Body is available for PS4 and PC. Go to softbodygame.com for more info.
1. THE GUTS OF THE MOVEMENT
The following is a simplified version of the game’s movement code:
///this runs every frame
body.x += gamepad_axis_value.x * move_speed
body.y += gamepad_axis_value.y * move_speed
On every frame, the body’s X and Y coordinates are modified by the position of the joystick. The joystick returns a value that ranges from -1 to 1 for both the horizontal axis (x) and the vertical axis (y). I made this rough visual aid to give you an idea of the joystick’s coordinate system:

To summarize: if the stick is pushed left or right, this affects ONLY the X value, and pushing the stick up or down affects ONLY the Y value.
The final value is the body’s move speed. The joystick values are multiplied by the move_speed variable, and it’s pretty straight-forward: the higher the value, the faster the body moves.
I decided against adding more complicated physics like momentum for two reasons:
- I love the feel of the controller’s joystick and the gentle resistance and elasticity of its spring. The simplicity of a 1-to-1 movement system allows the physical sensation of maneuvering the joystick to take center stage.
- I love responsive and tight controls in games and generally dislike action games that foreground the game physics with some sort of weightiness. Though momentum is great for emulating vehicular motion (like the spaceship in “Pixeljunk Shooter”), in my experience, weighty physics undermines the sensation of embodying an organic body.
2. A BEAUTIFUL, GOOEY SNAKE
Tightness and 1-to-1 movement controls play a huge role, but the flowing animation of the snake gives the game life and personality. In short, the body animation is just a bunch of different circles growing and shrinking.

Here’s a breakdown of how the body’s animation works:
- After the body has been moved to a new location with the joystick, a small circle is created on the body’s new location. A new circle is spawned every frame.
- For 10 or so frames, the circle steadily grows.
- After the 10th frame, the circle starts to shrink.
- Every frame, the circle has a 4% chance to begin wobbling. If wobbling is activated, the circle will move somewhere between -.5 and .5 pixels on both the X and Y axis every frame. This slight wobble gives the body a more organic, life-like animation. If the wobble isn’t activated for a circle, it never moves from its starting coordinate.
- When the circle’s radius is less than 0, the circle is destroyed.

It took me a while to tune the growth and shrinkage of the circles, but I thought it looked good from day 1.