Lope2D [Love2D Physics Engine]

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Doctory
Party member
Posts: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: Lope2D [Love2D Physics Engine]

Post by Doctory »

Nice ^^
I'm going to make something similar.
ilgamer
Prole
Posts: 10
Joined: Fri Apr 12, 2013 5:55 am

Re: Lope2D [Love2D Physics Engine]

Post by ilgamer »

alberto_lara, It didn't work with Love2D 0.9. Fixed it. Thank you!
ilgamer
Prole
Posts: 10
Joined: Fri Apr 12, 2013 5:55 am

Re: Lope2D [Love2D Physics Engine]

Post by ilgamer »

T-Bone wrote:Seems like a nice library. It doesn't really matter, but wouldn't it be better if you defined a single "lope" table instead of having lots of functions called "lope_x", like love does? So lope_drawWorld becomes lope.drawWorld. The benefits of this include having less globals and the option of easily changing the name of the entire table.
Done! Thank you.
ilgamer
Prole
Posts: 10
Joined: Fri Apr 12, 2013 5:55 am

Re: Lope2D [Love2D Physics Engine]

Post by ilgamer »

There is a wiki on bitbucket page. Check it out!
https://bitbucket.org/erlimoen/lope2d-v2/wiki
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Lope2D [Love2D Physics Engine]

Post by alberto_lara »

Hi ilgamer, any support for polygons in Lope2D? I barely checked the code and didn't find something about it.

Also I think I found an issue, I don't have an account in bitbucket so, sorry, I'm gonna leave it here:

Code: Select all

require "lope2d"
function love.load()
	gr = love.graphics
	gr.setColor(255, 127, 0)
	gr.setLineStyle("rough")
	r = love.math.random
	w = gr.getWidth()
	h = gr.getHeight()

	floor = lope.newBody("static", "rectangle", w / 2, h - 25, w, 50)
	lw = lope.newBody("static", "rectangle", 25, h / 2, 25, h)
	rw = lope.newBody("static", "rectangle", w - 25, h / 2, 25, h)
	ceiling = lope.newBody("static", "rectangle", w / 2, 25, w, 50)
	poly = lope.newBody("dynamic", "rectangle", 200, 200, 50, 50)
	

	bodies = {
		lw,
		rw,
		floor,
		ceiling,
		poly
	}

	pts = {}
end

function love.update(dt)
	lope.update(dt)
end

function love.draw()
	--lope.draw(bodies, "fill")
	lope.draw(bodies, "line")
end
The above simulation works just with "fill" in lope.draw()
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Lope2D [Love2D Physics Engine]

Post by alberto_lara »

Hi ilgamer, any support for polygons in Lope2D?
Ok, so I made some changes to lope2d.lua to actually support Polygons, no tested with images and the water pools, just the fill mode.

This is how you create a polygon:

Code: Select all

vertices = {
		{x = 194, y = 166},
		{x = 208, y = 149},
		{x = 243, y = 150},
		{x = 344, y = 232},
		{x = 301, y = 283},
		{x = 218, y = 314},
		{x = 160, y = 308}
	}

poly = lope.newBody("dynamic", "polygon", vertices)
Addeed validations for the max number of vertexes (8) and to check if the polygon is convex, hope this helps!
physics_test.love
(18.95 KiB) Downloaded 126 times
(Click the window to move the objects)
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Lope2D [Love2D Physics Engine]

Post by alberto_lara »

The link to bitbucket does not work, is this being maintained?
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: Lope2D [Love2D Physics Engine]

Post by pgimeno »

Looks like the user has been deleted. I keep a clone, if that helps. Not sure how current. Last commit is from April 7, 2014, and I'm pretty sure I cloned it December last year, so it's quite likely it was not maintained.
User avatar
EntranceJew
Prole
Posts: 31
Joined: Fri Apr 03, 2015 10:02 pm
Location: Saint Petersburg, Florida
Contact:

Re: Lope2D [Love2D Physics Engine]

Post by EntranceJew »

A good alternative to a simpler love.physics API would be hxdx although it has a few bugs that I've encountered.
sandsmas: A LÖVE Editor
My Libraries: Imgur, Palettes, Music Macros, Timer, Hooks
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Lope2D [Love2D Physics Engine]

Post by alberto_lara »

EntranceJew wrote:A good alternative to a simpler love.physics API would be hxdx although it has a few bugs that I've encountered.
Thanks for the note!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 162 guests