Page 1 of 1

What's the difference between load and require?

Posted: Fri Nov 21, 2014 10:00 pm
by vitto
I've tested a demo with a simple key press showed with a text on game window and it works in both cases:

Code: Select all

-- a file with load
love.filesystem.load("keypress.lua")()

-- a file with require
require "keypress"
what's the difference?

Re: What's the difference between load and require?

Posted: Sat Nov 22, 2014 4:09 am
by Azhukar
http://www.lua.org/pil/8.1.html

love.filesystem.load(file)() provides similar functionality as dofile in the lua manual.