Pölygamy: a collection of LÖVE helper libraries
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Pölygamy: a collection of LÖVE helper libraries
You won't lose the ability. (for now)
Re: Pölygamy: a collection of LÖVE helper libraries
To run it, you must put the Polygamy folder wherever you want to, and
It will create a global Polygamy object. From there, you can use it as described in the first post of this thread.
There were indeed stray files in the archive. I've uploaded a cleaned up version.
The next version, which I'm polishing right now[*], is more modular. The custom love.run is extracted as library and is optional for both the state and keyboard lib.
Actually, it is extremely similar to the normal love.run loop, except that you can insert, remove and switch callbacks at a predictable point in the loop, ensuring that all callbacks are consistent at any given time. Polygamy works without it, but it makes things more transparent and more efficient.
The next Polygamy is almost self contained.
Edit: Refactoring done, the (upcoming) state library is love.run() agnostic.
[*] Lesson learned: never again will I let some half-refactored code rot for a few months.[/size]
Code: Select all
require "path.to.Polygamy.init"
There were indeed stray files in the archive. I've uploaded a cleaned up version.
The next version, which I'm polishing right now[*], is more modular. The custom love.run is extracted as library and is optional for both the state and keyboard lib.
Actually, it is extremely similar to the normal love.run loop, except that you can insert, remove and switch callbacks at a predictable point in the loop, ensuring that all callbacks are consistent at any given time. Polygamy works without it, but it makes things more transparent and more efficient.
The next Polygamy is almost self contained.
- the keyboard lib relies on the presence of the love.keypressed() and love.keyreleased() callbacks.
- the state lib could relies only on love.update() and love.draw().
- the upcoming timer lib relies on love.timer.getTime().
- the upcoming soundtrack lib is a more invasive by design, but it only relies on love.sound.newSource, the presence of a metatable for source objects, source:getVolume and source:setVolume.
Edit: Refactoring done, the (upcoming) state library is love.run() agnostic.
[*] Lesson learned: never again will I let some half-refactored code rot for a few months.[/size]
Last edited by pygy on Wed Jul 21, 2010 9:48 am, edited 2 times in total.
Hermaphroditism is not a crime. -- LSB Superstar
All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
Re: Pölygamy: a collection of LÖVE helper libraries
Pölygamy 0.4.1 doesn't work with Löve 0.8.0
It is easy to fix, just do the following:
in init.lua:
To make the example 'main.lua' work, also replace "love.event.push('q')" wint "love.event.push('quit')"
Hope that helps somebody
It is easy to fix, just do the following:
in init.lua:
- replace handlers.q with handlers.quit
add 'love.event.pump()' before 'for e,a,b,c in love.event.poll() do'
replace 'a,b,c' with 'a,b,c,d in 'love.event.poll()' loop
change '1' in love.timer.sleep( 1 ) to 0.001
remove '..".lua"' from line 259 at 'require(Polygamy.path .."modules/" .. moduleIndex[module_] .. ".lua");'
To make the example 'main.lua' work, also replace "love.event.push('q')" wint "love.event.push('quit')"
Hope that helps somebody
Re: Pölygamy: a collection of LÖVE helper libraries
Wow!
Cool to know that someone is still using this :-)
I'll update the library, thanks for the report...
Cool to know that someone is still using this :-)
I'll update the library, thanks for the report...
Hermaphroditism is not a crime. -- LSB Superstar
All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
Who is online
Users browsing this forum: No registered users and 2 guests