Page 3 of 23

Re: 0.6.0 Update

Posted: Wed Sep 02, 2009 2:02 pm
by Robin
anjo wrote:I don't know why it was removed (you'd have to ask rude, sorry). Fortunately, not all is lost - it's not impossible to write your own restart() function that goes something like this:
I believe it was due to LÖVE's new status as "it's also a library", which basically means main loop in Lua and all -- so LÖVE can't assume to have control over code execution.
anjo wrote:

Code: Select all

function restart()
   love.load()
end
Of course, that only works if you are resetting the whole game state in love.load() -- so that probably means having to reload all libraries there, and so on.

Re: 0.6.0 Update

Posted: Wed Sep 02, 2009 2:36 pm
by bmelts
Robin wrote:Of course, that only works if you are resetting the whole game state in love.load() -- so that probably means having to reload all libraries there, and so on.
Well, certainly the function can be more than just that one line -- e.g. if you're taking advantage of box2d you'd want to delete all Bodies before reloading, and if you're require()ing files you'd need to make sure Lua knows you actually want to load them a second time -- but for simpler games, calling love.load() again will probably be adequate.

Re: 0.6.0 Update

Posted: Wed Sep 02, 2009 2:40 pm
by bartbes
Require will not reload the code, so that fails..
However, it is good coding practice to initialize all variables you need before using them, thus by starting the initialization process again the game should 'restart'. Think of it as a soft restart :P Of course this leaves a few things, physics might be solved by removing the reference to the world (and all bodies and shapes, etc), however, audio might not be that easy..

Re: 0.6.0 Update

Posted: Wed Sep 02, 2009 5:33 pm
by rude
Damn, anjo, how do you know all this? Good thing someone is keeping track of changes -- I have no idea what's going on. :neko:

Robin is right about restart. It simply can't be done anymore. I also liked restart a lot, but we have to make custom reloads from now on. You can do this to load a file again, even if it has been required before:

Code: Select all

local f = love.filesystem.load("file.lua")
f() -- This calls the file.
I suppose we could add love.filesystem.dofile() to achieve this too.

Re: 0.6.0 Update

Posted: Wed Sep 02, 2009 6:43 pm
by bartbes
Then again, isn't it just a 'macro' for love.filesystem.load(f)()? I mean, is anybody too lazy for that?

Re: 0.6.0 Update

Posted: Wed Sep 02, 2009 10:31 pm
by snake
I ported the example browser to love 0.6.
Hope this might help someone.

(Sorry, I had no time to test it well, so some examples might be buggy )

Re: 0.6.0 Update

Posted: Wed Sep 02, 2009 11:06 pm
by osgeld
I am abit disappointed to see animations go, The issue with reset doesnt really bother me (i used it for the first time ever for LD15, and thats just cause I did not manage any of my resources at all) and I am glad to see more advanced image functionality

I do have some issues tho,

1) Are we going to see binaries early on? cause I must be compile tarded or something, every time I see just run make, I KNOW its either not going to work, or I am going to spend a freakin week just to get it to half work

2) Documentation! .5's docs are lacking but mostly present, my problem is "the powers that be" seem to have this fear of community written documentation, and at the same time these same powers seem to be confused on how and what is actually going on in this new version. The combination of the 2 does not make me envision a fun learning process

Re: 0.6.0 Update

Posted: Thu Sep 03, 2009 1:48 am
by bmelts
osgeld wrote:1) Are we going to see binaries early on? cause I must be compile tarded or something, every time I see just run make, I KNOW its either not going to work, or I am going to spend a freakin week just to get it to half work
There should be binaries up at http://www.love2d.org/builds/ for your OS of choice. If running make doesn't work, please let rude know so it can be fixed - the source ought to build on any system with the requisite libraries, if I'm not mistaken.
osgeld wrote:2) Documentation! .5's docs are lacking but mostly present, my problem is "the powers that be" seem to have this fear of community written documentation, and at the same time these same powers seem to be confused on how and what is actually going on in this new version. The combination of the 2 does not make me envision a fun learning process
Documentation is on the list of Things To Do™ before the official release of 0.6.0, have no fear.

Re: 0.6.0 Update

Posted: Thu Sep 03, 2009 7:26 am
by rude
http://www.love2d.org/builds/ contains some binaries, yes, but it's not completely done. Each snapshot should be available for all platforms. That's currently not the case.

Documentation: I have one new generator ready, but it's not that suitable for Wikis; it uses XML to store data. None of the wiki engines I current know of are suitable, so we have to make our own. That's going to take some time. Should perhaps make a primitive temporary documentation with just changes and additions so everyone can start using the snapshots.
osgeld wrote:these same powers seem to be confused
Haha, I wouldn't worry about that. ;)

Re: 0.6.0 Update

Posted: Thu Sep 03, 2009 1:47 pm
by bartbes
osgeld wrote:I am abit disappointed to see animations go
Well, I hope it helps that I try to easy the pain... AnALly :P (sorry, that was just too easy)