Hey, I've been digging around through the documentation and whatnot and I can't quite seem to get this to work.
The game I'm working on now is going to have a single player and a multi-player mode, each of which will work slightly different from each other in both the draw and update sections, and require different variables from one another. so essentially, to avoid clutter, the easiest way to handle this seems like it would be like this: Have the main program file essentially be a launcher of some kind, with just a menu, and once you choose single or multi, it runs another LOVE file corresponding to the choice you made. Is this possible? And if so, how?
Thanks in advance!
Running separate love files
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Running separate love files
In one word: no.
But overloading draw and update is possible:
Then you could put all functions and global variables into the single and multi tables, so that they don't collide with each other.
But overloading draw and update is possible:
Code: Select all
function chooseSinglePlayer()
update = single.update
draw = single.draw
end
function chooseMultiPlayer()
update = multi.update
draw = multi.draw
end
Help us help you: attach a .love.
-
- Prole
- Posts: 6
- Joined: Mon Nov 09, 2009 6:02 am
Re: Running separate love files
Thanks a lot for the help, I've been working with this kind of a structure since you posted it, and it's really getting somewhere. It's much easier to have separate documents for the different phases of the game and then have the game switch around between them. My "main" file was getting a little silly.
Who is online
Users browsing this forum: No registered users and 14 guests