Skip to content

Creating metaball animations

WARNING: I DID NOT EVEN TEST THIS LMAO

Metaballs are useful for effects like blobs, liquids, and smooth animations.

local systemId = gpu.createMetaballSystem(displayId)
local ball = gpu.addMetaball(
systemId,
50,
50,
20,
1
)

Change its color:

gpu.setMetaballColor(
systemId,
ball,
0,
200,
255
)
while true do
gpu.clear(displayId, 0, 0, 0)
gpu.updateMetaballs(
systemId,
0.05
)
gpu.renderMetaballs(
systemId,
1,
0
)
gpu.updateDisplay(displayId)
sleep(0.05)
end