Creating metaball animations
WARNING: I DID NOT EVEN TEST THIS LMAO
Metaballs are useful for effects like blobs, liquids, and smooth animations.
Creating a system
Section titled “Creating a system”local systemId = gpu.createMetaballSystem(displayId)Adding metaballs
Section titled “Adding metaballs”local ball = gpu.addMetaball( systemId, 50, 50, 20, 1)Change its color:
gpu.setMetaballColor( systemId, ball, 0, 200, 255)Updating every frame
Section titled “Updating every frame”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