I must say i find the load() function name a little not-fitting. I would suggest renaming it to initialize(), which i think fits better. I believe any kind of initialization goes on in that function, not just loading Which brings me to another thought. Is the function even necessary? Is it called when you do a love.system.restart() ? Because otherwise if i am not mistaken, all the code could just be put right into the file without the function?
What are people's thoughts about this?
I am not sure if such suggestions are wanted, and i'm not much for breaking compatibility, but i figured we haven't reached version 1.0 yet, so the api is bound to change
suggested callback initialize()
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: suggested callback initialize()
It's not technically needed, no. Still, it will remain, because less experienced game developers will more quickly understand where to place their loading code.
In the next version, you can choose to not use load/update/draw altogether, and work directly on the main loop.
All kinds of suggestions are welcome, even after 1.0.
In the next version, you can choose to not use load/update/draw altogether, and work directly on the main loop.
All kinds of suggestions are welcome, even after 1.0.
Re: suggested callback initialize()
Will we see LÖVE more like a library rather than a framework?rude wrote:In the next version, you can choose to not use load/update/draw altogether, and work directly on the main loop.
Code: Select all
local love = require"love"
love.dosomething()
Re: suggested callback initialize()
Yes and no.
Yes: I'm structuring the next version so that it should be possible to compile LÖVE as a DLL and use it in any Lua interpreter using normal library loading facilities.
No: An important part of LÖVE's simplicity is the embedded virtual machine, so we will by no means move towards a pure library oriented approach. The current setup will remain, but with more flexibility (i.e. optional control over the main loop and messages queue).
Having a DLL can be very useful for development purposes. It would allow us to use existing debuggers and specialized IDE's. Note that unless you want to do all setup code yourself, using LÖVE as library requires that you call a function which enters the main loop at the end of your script. Something like this:
Yes: I'm structuring the next version so that it should be possible to compile LÖVE as a DLL and use it in any Lua interpreter using normal library loading facilities.
No: An important part of LÖVE's simplicity is the embedded virtual machine, so we will by no means move towards a pure library oriented approach. The current setup will remain, but with more flexibility (i.e. optional control over the main loop and messages queue).
Having a DLL can be very useful for development purposes. It would allow us to use existing debuggers and specialized IDE's. Note that unless you want to do all setup code yourself, using LÖVE as library requires that you call a function which enters the main loop at the end of your script. Something like this:
Code: Select all
require("love")
-- standard code:
function load()
image = love.graphics.newImage("awesome.png")
end
function update(dt)
end
-- etc
-- This must be called at the end of the file.
love.init()
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 8 guests