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.
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.
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.
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 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..
Damn, anjo, how do you know all this? Good thing someone is keeping track of changes -- I have no idea what's going on.
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:
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
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.
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