/project/loveballs

A LÖVE Softbody Library

LÖVE Balls is a softbody library for LÖVE

Usage is pretty simple, just clone the repo and shove the loveballs directory into your project folder and include it in your Lua code. Here’s a bit of example code.

This example assumes you have a World that is updating each frame along with something to collide with. See the Github repo for a more complete example.

-- Softbody args (x, y, radius, smoothing, tessellate iterations)
wolrd    = love.physics.newWorld(0, 9.81*16, true)
softball = Softbody(world, 400, -200, 100, 2, 4)

-- call this each frame
world:update(dt)
softball:update()

-- render the softbody a solid blue color
love.graphics.setColor(0, 0, 255)
softball:draw()

And here’s what it might look like. The “oddly” shaped softbody on the left is the result of an experiment gone wrong and not intentional at all… honestly.

BallsBalls