Page 1 of 1

Including multiple files into the game/program

Posted: Tue Mar 30, 2010 3:31 pm
by Divran
Hello. I have a quick question.
I have my main.lua file, but how do I include multiple lua files and have them run on load? It gets really messy with ALL the code in one single file.
Thanks.

EDIT:
I also have another question:
Several functions on the wiki state they have "modes". For example, the rectangle. The wiki does not give a list of all available modes, however. If you can tell me of a place where I can see all available modes of any function that has a "mode" argument, that would be great. If not, people who know all available modes should consider listing them in their corresponding function on the wiki.

Re: Including multiple files into the game/program

Posted: Tue Mar 30, 2010 3:55 pm
by bartbes
First question:
Check out the lua function require, it works almost the same in LÖVE, except the . syntax seems a little buggy... so you might want to use /. (that dot is not part of the replacement btw)

Second question:
"line" and "fill"

Re: Including multiple files into the game/program

Posted: Tue Mar 30, 2010 4:05 pm
by Divran
bartbes wrote:Second question:
"line" and "fill"
That's only for one function. I meant ANY function that has a "mode" argument.

Re: Including multiple files into the game/program

Posted: Tue Mar 30, 2010 4:41 pm
by bartbes
AFAIK those are the modes for all of those functions.

Re: Including multiple files into the game/program

Posted: Tue Mar 30, 2010 5:00 pm
by Robin
Divran wrote:
bartbes wrote:Second question:
"line" and "fill"
That's only for one function. I meant ANY function that has a "mode" argument.
Click on the type of the mode. That gives you a list.

Re: Including multiple files into the game/program

Posted: Tue Mar 30, 2010 5:31 pm
by bmelts

Re: Including multiple files into the game/program

Posted: Tue Mar 30, 2010 5:55 pm
by bartbes
Oh, THOSE modes... aren't they all clickable?

Re: Including multiple files into the game/program

Posted: Tue Mar 30, 2010 7:00 pm
by Divran
Robin wrote:
Divran wrote:
bartbes wrote:Second question:
"line" and "fill"
That's only for one function. I meant ANY function that has a "mode" argument.
Click on the type of the mode. That gives you a list.
Ah thanks. Didn't see that was a link.

And thanks, require worked.