Showcase your libraries, tools and other projects that help your fellow love users.
-
unixfreak
- Citizen
- Posts: 79
- Joined: Thu Oct 15, 2015 6:25 am
- Location: Bristol, UK
-
Contact:
Post
by unixfreak » Wed Jul 31, 2019 6:01 pm
This module creates a drawable surface with some HSL bouncing metaballs.
Maybe someone will find this useful as a starting point for something else. Code can be found here:
https://github.com/Jigoku/love2d_metaballs
Basic Usage:
Code: Select all
function love.load()
require("metaballs")
metaballs.create(8) -- spawn 8 metaballs
end
function love.draw()
love.graphics.draw(metaballs.surface(),0,0)
end
function love.update(dt)
metaballs.update(dt)
end
This was inspired by a coding challenge video i came across recently:
https://www.youtube.com/watch?v=ccYLb7cLB1I
-
Attachments
-
metaballs.love
- (1.99 KiB) Downloaded 131 times
-
azoyan
- Prole
- Posts: 18
- Joined: Wed Dec 27, 2017 5:19 pm
Post
by azoyan » Thu Aug 01, 2019 9:17 am
Looks great!
-
YoungNeer
- Party member
- Posts: 118
- Joined: Wed May 15, 2019 7:49 am
Post
by YoungNeer » Thu Aug 01, 2019 1:00 pm
Perhaps I could use this as background in my MainMenuState. Thanks a lot

My Github- your contribution is highly appreciated
-
grump
- Party member
- Posts: 657
- Joined: Sat Jul 22, 2017 7:43 pm
Post
by grump » Thu Aug 01, 2019 2:18 pm
Looks nice! I played around with it for a bit and made some optimizations. The calculation is now done in a shader, and the texture is not recreated every frame. It's quickly hacked in though, so the code is far from optimal and not very pretty.

-
Attachments
-
metaballs2.love
- (2.02 KiB) Downloaded 124 times
-
unixfreak
- Citizen
- Posts: 79
- Joined: Thu Oct 15, 2015 6:25 am
- Location: Bristol, UK
-
Contact:
Post
by unixfreak » Thu Aug 01, 2019 4:13 pm
grump wrote: ↑Thu Aug 01, 2019 2:18 pm
Looks nice! I played around with it for a bit and made some optimizations. The calculation is now done in a shader, and the texture is not recreated every frame. It's quickly hacked in though, so the code is far from optimal and not very pretty.
Hey, that's cool. Yeah, runs much faster as a shader. I still haven't a clue at writing things via shader language, will have to dig into that more in the future.

Users browsing this forum: No registered users and 24 guests