Page 1 of 1

Difference Between love.load() and Top of File?

Posted: Sat May 03, 2014 5:25 pm
by EchoFive
What's the difference between love.load() and the top of the file? To my understanding, the main.lua file is only run once, so wouldn't the top of the file be equivalent to putting the same data in love.load()? If so, what is the purpose of love.load()?

Re: Difference Between love.load() and Top of File?

Posted: Sat May 03, 2014 6:33 pm
by khamarr3524
I believe one of the main points is that with love.load you can pass command line arguments to Love.

Please see: http://www.love2d.org/wiki/love.load This is where I got the information.

Re: Difference Between love.load() and Top of File?

Posted: Sat May 03, 2014 11:18 pm
by DaedalusYoung
Also, technically, you can be sure that all love.* functions exist when love.load is called, or something like that I read somewhere.

Re: Difference Between love.load() and Top of File?

Posted: Sun May 04, 2014 5:11 am
by T-Bone
The difference, as far as I know, is that some things might not be fully loaded when you run stuff at the top of the file. Another benefit of using love.load is that you can restart the game by calling love.load again.