Pölygamy: a collection of LÖVE helper libraries

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
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

Post by bartbes »

pygy wrote:
  • TypeMatic (key repeat).
  • Unicode.
Those are in love itself?!
User avatar
pygy
Citizen
Posts: 98
Joined: Mon Jan 25, 2010 4:06 pm

Re: Pölygamy: a collection of LÖVE helper libraries

Post by pygy »

Regarding unicode, it simply meant "look into the love doc to see how to pass the right argument" ;) since it was on the to do list, I moved it to the change log without thinking much.

I initially planned to bind a per configuration typematic setting, but I'll get rid of it in the next version, it makes things more complicated for everyone, with little to no gain.
Hermaphroditism is not a crime. -- LSB Superstar

All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
User avatar
pygy
Citizen
Posts: 98
Joined: Mon Jan 25, 2010 4:06 pm

Re: Pölygamy: a collection of LÖVE helper libraries

Post by pygy »

Version 0.4.0 is up, as a .love file this time, with a bare bone demo for Polygamy.keyboard and Polygamy.state. :-)

Change log:
  • First release of Polygamy.state
  • Simplification of the Polygamy.keyboard API
  • Custom love.run loop with the ability to insert custom callbacks in the main loop
  • The modules are loaded on the fly when needed, and their corresponding callbacks are inserted in the main loop automatically.
  • Removed the per config typematic support.
  • Polygamy.timer is also bundled, but it's untested and certainly buggy
The documentation in the first post has been changed to match the new API
Hermaphroditism is not a crime. -- LSB Superstar

All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
tiotags
Prole
Posts: 5
Joined: Tue Dec 29, 2009 5:36 pm

Re: Pölygamy: a collection of LÖVE helper libraries

Post by tiotags »

it doesn't work on linux :( ( I think the paths aren't cross platform)
User avatar
pygy
Citizen
Posts: 98
Joined: Mon Jan 25, 2010 4:06 pm

Re: Pölygamy: a collection of LÖVE helper libraries

Post by pygy »

Thanks for the report.

It wasn't working from the .love here either. It was actually a case error in the paths, which are ignored in OS X but not on Linux or from the archive...

Could you try 0.4.1 and report back? (see the first post).

BTW, Pölygamy is in alpha... I'm still trying to get the API right. While the semantics should remain consistent, the syntax and API details may still change from version to version.
Hermaphroditism is not a crime. -- LSB Superstar

All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Pölygamy: a collection of LÖVE helper libraries

Post by nevon »

Any chance you could reupload Polygamy to another host? I would like to use it in a game I'm currently developing, but ever since the forums started acting up, all the downloads have been broken.
User avatar
pygy
Citizen
Posts: 98
Joined: Mon Jan 25, 2010 4:06 pm

Re: Pölygamy: a collection of LÖVE helper libraries

Post by pygy »

Glad to hear that!

I don't have web access at home currently, so it may take some time...
I'm currently polishing the next version.
I'll upload the previous, stable one ASAP.
Hermaphroditism is not a crime. -- LSB Superstar

All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Pölygamy: a collection of LÖVE helper libraries

Post by nevon »

pygy wrote:Glad to hear that!

I don't have web access at home currently, so it may take some time...
I'm currently polishing the next version.
I'll upload the previous, stable one ASAP.
What's new in the next version? If it's not too far off from being released, and there are features that could be useful to me, I might just hold off until you've got that released. Either way, thanks for taking the time to re-upload the previous version.
User avatar
pygy
Citizen
Posts: 98
Joined: Mon Jan 25, 2010 4:06 pm

Re: Pölygamy: a collection of LÖVE helper libraries

Post by pygy »

The core functionality will remain the same, and it should be mostly backwards compatible.

First, I'll add more modularity.
  • The custom love.run() loop will be exported to it's own lib: RunawayBrïde, and the other libraries depend on it.
  • The timer/scheduler lib will be called SerialDäter, and will be developed separately.
    I may add a "transition" module, where a function is called each frame for a given time (to implement a fade in/out, for example).
  • Pölygamy itself will concentrate on "making LÖVE, multiple times" i.e. game state management and input DSL (keyboard only ATM).
    For the state module:I'd like to implement stackable states, and a way be able to use each module independently (as it is the case at the moment) or to globally switch the state of all active modules in one command, achieving maximal flexibility and integration, at the Lover's best convenience.
    For the keyboard module: I've started some refactoring and simplification: some patterns are of little use,for example, and I'll change the column/row coordinate system (home row = 0, positive upwards, negative downwards, and the arrows/keypad will get x/y coordinates too, using the same logic). Also, an alternative, "syntaxless" DSL is planned.
Here's an example of the DSL

Code: Select all

keyboard "ingame" :config
    "esc"    :pressed (function() goto "menu" end)
    "arrows" :held    (function(key, x, y, dt) hero:move(key,dt) end)
    {" ", "return"}
      :pressed  (function() hero:shoot() end)
      :held     (function(dt) hero:accumulateEnergy(dt) end)
      :released (function() hero:KABOOM() end) 
"" -- "" closes the definition.
It would look far better if Lua had a short lambda syntax... I've written a patch that allows to write it like this:

Code: Select all

keyboard "ingame" :config
    "esc"    :pressed .:( ; goto "menu" )
    "arrows" :held    .:( key, x, y, dt; hero:move(key,dt) )
    {" ", "return"}
      :pressed  .:( ; hero:shoot() )
      :held     .:(dt; hero:accumulateEnergy(dt) )
      :released .:( ; hero:KABOOM() )
""
The Lua authors don't seem interrested, though.
Last edited by pygy on Fri Apr 16, 2010 9:37 pm, edited 3 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.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Pölygamy: a collection of LÖVE helper libraries

Post by kikito »

My two cents on this:

I had the same problem while developing PÄSSION; passing functions around seemed very inefficient and somewhat ugly.

Code: Select all

player:observe('keypress_a', function() player:moveRight(10) end)
I noticed that most of the time I was using functions that looked like this: function() someObject:otherFunction() end.

What I ended up doing was accepting functions but also method names. I can now do the previous code this way:

Code: Select all

player:observe('keypress_a', 'moveRight', 10)
So instead of trying to modify Lua, I modified my classes, which are far easier to modify :P

EDIT: here's an example of how this behaviour is implemented on the Beholder module.
When I write def I mean function.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 1 guest