0.6.0 Update

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: 0.6.0 Update

Post 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.
Help us help you: attach a .love.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: 0.6.0 Update

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 0.6.0 Update

Post 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..
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: 0.6.0 Update

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 0.6.0 Update

Post by bartbes »

Then again, isn't it just a 'macro' for love.filesystem.load(f)()? I mean, is anybody too lazy for that?
snake
Citizen
Posts: 52
Joined: Tue Jul 14, 2009 6:59 pm

Re: 0.6.0 Update

Post 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 )
Attachments
examples0.6.love
(18.97 KiB) Downloaded 169 times
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: 0.6.0 Update

Post 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
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: 0.6.0 Update

Post 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.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: 0.6.0 Update

Post 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. ;)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 0.6.0 Update

Post 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)
Post Reply

Who is online

Users browsing this forum: zingo and 5 guests