Difference Between love.load() and Top of File?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Difference Between love.load() and Top of File?
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()?
-
- Prole
- Posts: 41
- Joined: Thu Sep 05, 2013 8:48 pm
Re: Difference Between love.load() and Top of File?
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.
Please see: http://www.love2d.org/wiki/love.load This is where I got the information.
- DaedalusYoung
- Party member
- Posts: 413
- Joined: Sun Jul 14, 2013 8:04 pm
Re: Difference Between love.load() and Top of File?
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?
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.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: No registered users and 3 guests