Breezefield: a lightweight windfield alternative (love.physics wrapper)

Showcase your libraries, tools and other projects that help your fellow love users.
TheHUG
Citizen
Posts: 62
Joined: Sun Apr 01, 2018 4:21 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by TheHUG »

following viewtopic.php?f=4&t=86610 I've made another update - I've ensured breezefield doesn't export any global variables that could interfere with globals defined in the game.
TheHUG
Citizen
Posts: 62
Joined: Sun Apr 01, 2018 4:21 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by TheHUG »

I've implemented queryEdgeArea and fixed some bugs with querying.
A-lox
Prole
Posts: 43
Joined: Sun Apr 10, 2022 1:58 am

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by A-lox »

how to make objects move in winfield
SugarRayLua
Citizen
Posts: 55
Joined: Sat Dec 03, 2022 7:52 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by SugarRayLua »

Hi. I'm a newbie learning physics in Love2d and found both your Breezefield library and the Winfield library are great helps to simplify my coding.

Can Breezefield create angle rotated shapes like one can with this love.physics base command:

shape = love.physics.newRectangleShape( x, y, width, height, angle ) ?

It doesn't look like one can do that with the Winfield library but wasn't sure if it was possible in your Breezefield library.

Thanks!
TheHUG
Citizen
Posts: 62
Joined: Sun Apr 01, 2018 4:21 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by TheHUG »

Hi, sorry for the late reply. `world:newCollider('Rectangle', {x, y, w, h, a})` would do the trick. Any args that would be passed to love.physics.<shape> can be put in that second argument.

A-lox, breezefield wraps existing love2d physics functionality. To move a Collider, you can use any method you can normally use from a Body, Fixture or Shape. For movement that would be things like setX, setY, setLinearVelocity, applyForce. See here: https://love2d.org/wiki/Body for all the various options.
SugarRayLua
Citizen
Posts: 55
Joined: Sat Dec 03, 2022 7:52 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by SugarRayLua »

Thanks! 😊
ThatBoiNavy
Prole
Posts: 15
Joined: Fri Jul 05, 2024 6:39 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by ThatBoiNavy »

I think I might have found an error in world.lua... at line 299 it says "attempted to call method "upper" (a nil value). Im not sure if anyone else is having this problem as right now it is breaking my game.
TheHUG
Citizen
Posts: 62
Joined: Sun Apr 01, 2018 4:21 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by TheHUG »

ThatBoiNavy wrote: Thu Aug 08, 2024 11:11 pm I think I might have found an error in world.lua... at line 299 it says "attempted to call method "upper" (a nil value). Im not sure if anyone else is having this problem as right now it is breaking my game.
Hi! I've updated the tests to verify that the line in question works. How are you calling the `newCollider` method? the first argument (excluding 'self' of course) should be a string.
I'll make a new PR to provide a more informative error message if the value passed is not a string.

I would be grateful if you could take a look at the change to world.lua here and let me know if it would have prevented your issue: https://github.com/HDictus/breezefield/pull/24
User avatar
pgimeno
Party member
Posts: 3635
Joined: Sun Oct 18, 2015 2:58 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by pgimeno »

Problems like this have arisen with many libraries, and have been raised in the forums often. This user ran into the issue with one specific method, but it's likely that it could have happened with many other methods, and even with many other libraries. Patching every method of every library would make them bloated and slower, which is probably why almost no library creator holds the user's hand to that point.
ThatBoiNavy
Prole
Posts: 15
Joined: Fri Jul 05, 2024 6:39 pm

Re: Breezefield: a lightweight windfield alternative (love.physics wrapper)

Post by ThatBoiNavy »

I call it like this:
british.collider = world:newCollider('Rectangle', {british.x, british.y, 50, 39, 5})
british.collider:setFixedRotation(true)
Post Reply

Who is online

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