Running multiple .lua files in a game?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 8
- Joined: Sat Aug 06, 2016 2:41 pm
Running multiple .lua files in a game?
Hello, I'm new to Lua and Love2D, and basically I'm trying to make the "main menu" as the first thing,but basically since the main.lua file would be very long i wanted to make another .lua file, called "menu.lua". But when I run the entire folder, nothing happens: only black screen. How do I run the other file?
Re: Running multiple .lua files in a game?
Require files section
Read the PIL
Read the PIL
Code: Select all
-- other.lua
function helloWorld()
print("Hello World")
end
-- main.lua
require("other")
helloWorld() -- prints "Hello World" to the console
-
- Prole
- Posts: 8
- Joined: Sat Aug 06, 2016 2:41 pm
Re: Running multiple .lua files in a game?
Thanks a lot! 

Who is online
Users browsing this forum: Google [Bot] and 10 guests