Loveballs, A love2d Softbody lib

Showcase your libraries, tools and other projects that help your fellow love users.
IndieRetro
Citizen
Posts: 51
Joined: Mon Apr 15, 2013 8:21 pm
Contact:

Re: Loveballs, A love2d Softbody lib

Post by IndieRetro »

ArchAngel075 wrote:to be honest here im more keen on seeing how you pulled off spacing of your outer nodes on arbitrary shapes since mine is just not worth it at times - outer nodes get placed so awkwardly at times.

I am more focused on setRadius as i really wanted to fix (and did) some bugs.

Im going to wait for arbitrary shapes to be implemented and then add a scaling feature (like setRadius)

After that i badly want to see if i can pull of a lerp between shapes (become a square from a triangle and back..for soft bodies?!)


##EDIT##

Patched my radiusSet branch to now change the self.centerShape radius correctly. This points to a hopefully final part of the branch (there are 0 bugs that i am aware of)
loveballs - setRadius.love
controls :
z and x - increase and decrease radius of softBody
a and d - roll left and right

Hey this is looking really good, I'll merge the setRadius with the lib soon :)

Heres a snippet of code on how I do the outerNodes. A word of warning, its really messy because I've been debugging and trying random stuff.

Code: Select all

	self.nodeShape = love.physics.newCircleShape(8);
	self.nodeShape2 = love.physics.newCircleShape(14);

	for i=1,#points,2 do
		local x = points[i];
		local y = points[i+1];

		if points[i+2] then
			local x2 = points[i+2];
			local y2 = points[i+3];

			local angle = math.atan2(y2 - y, x2 - x);
			local count = math.dist(x, y, x2, y2)/(self.nodeShape:getRadius()*1.8);

			for j=1,count do

				local dx = (j*(self.nodeShape:getRadius()*2)) * math.cos(angle);
				local dy = (j*(self.nodeShape:getRadius()*2)) * math.sin(angle);

				local b = love.physics.newBody(world, x+dx, y+dy, "dynamic");
				local f = love.physics.newFixture(b, self.nodeShape2);

				table.insert(self.nodes, {body = b, shape = self.nodeShape2, fixture = f});
			end
irc.freenode.org ##oodnet
http://exez.in/
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Loveballs, A love2d Softbody lib

Post by ArchAngel075 »

do note my houses power will die in 5 minutes (ZA -sigh-) Excuse any rushing

Im actually surprised by your approach, didnt think of using a node count method.

Also, is [math.dist] really a thing? becuse the number of times i lazily ripped the math from mlib (lazyness) is uncountable.
User avatar
DaedalusYoung
Party member
Posts: 407
Joined: Sun Jul 14, 2013 8:04 pm

Re: Loveballs, A love2d Softbody lib

Post by DaedalusYoung »

I'm sure you have to add math.dist yourself, see this wiki page: [wiki]General_math[/wiki]
IndieRetro
Citizen
Posts: 51
Joined: Mon Apr 15, 2013 8:21 pm
Contact:

Re: Loveballs, A love2d Softbody lib

Post by IndieRetro »

Just an update, I'm currently working on a project using this, well a slightly different version.

Ice

Editor

More ice
irc.freenode.org ##oodnet
http://exez.in/
User avatar
Reef
Prole
Posts: 33
Joined: Sun Mar 04, 2012 10:19 pm

Re: Loveballs, A love2d Softbody lib

Post by Reef »

This is really cool. I hope you make a game with this!
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Loveballs, A love2d Softbody lib

Post by adnzzzzZ »

That's some really cool shit. Make sure the game has actual gameplay though instead of just physics based moving arounding stuff, since that gets old pretty fast.
IndieRetro
Citizen
Posts: 51
Joined: Mon Apr 15, 2013 8:21 pm
Contact:

Re: Loveballs, A love2d Softbody lib

Post by IndieRetro »

adnzzzzZ wrote:That's some really cool shit. Make sure the game has actual gameplay though instead of just physics based moving arounding stuff, since that gets old pretty fast.
Yep, I'm going to try and keep the for-show bits down to a minimum, and have lots of physical puzzles and platforming around, like big swings and stuff that you have to jump across ^^
irc.freenode.org ##oodnet
http://exez.in/
Connorses
Citizen
Posts: 63
Joined: Fri Sep 06, 2013 7:02 am

Re: Loveballs, A love2d Softbody lib

Post by Connorses »

IndieRetro wrote:
adnzzzzZ wrote:That's some really cool shit. Make sure the game has actual gameplay though instead of just physics based moving arounding stuff, since that gets old pretty fast.
Yep, I'm going to try and keep the for-show bits down to a minimum, and have lots of physical puzzles and platforming around, like big swings and stuff that you have to jump across ^^
Since I played Gish (I'm probably it's biggest fan O_O), I've already seen a lot of that done and I was thinking about how I can make something with a unique feel rather than copying the style completely. Before I do that, however, I need to implement a level editor, and I wanted to ask if you'll show me how you built the maps in those videos with all the vector art and smooth ramps. They look amazing!
IndieRetro
Citizen
Posts: 51
Joined: Mon Apr 15, 2013 8:21 pm
Contact:

Re: Loveballs, A love2d Softbody lib

Post by IndieRetro »

Connorses wrote:
IndieRetro wrote:
adnzzzzZ wrote:That's some really cool shit. Make sure the game has actual gameplay though instead of just physics based moving arounding stuff, since that gets old pretty fast.
Yep, I'm going to try and keep the for-show bits down to a minimum, and have lots of physical puzzles and platforming around, like big swings and stuff that you have to jump across ^^
Since I played Gish (I'm probably it's biggest fan O_O), I've already seen a lot of that done and I was thinking about how I can make something with a unique feel rather than copying the style completely. Before I do that, however, I need to implement a level editor, and I wanted to ask if you'll show me how you built the maps in those videos with all the vector art and smooth ramps. They look amazing!

The level editor is pretty simple really. Mostly just meshes and sprites for scenery. I'll go make a cupa' tea and do a dev blog post on the editor and how it all works! I'll reply to your comment once its done (http://www.indieretro.co.uk)

In the mean time, heres the latest video:



EDIT: I've made a blog post on it here :)
Last edited by IndieRetro on Mon Feb 09, 2015 7:46 pm, edited 1 time in total.
irc.freenode.org ##oodnet
http://exez.in/
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Loveballs, A love2d Softbody lib

Post by Jasoco »

That's amazing. Like simply amazing.
Post Reply

Who is online

Users browsing this forum: No registered users and 51 guests