What's the difference between load and require?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
vitto
Prole
Posts: 10
Joined: Wed Nov 19, 2014 5:50 pm
Location: Italy
Contact:

What's the difference between load and require?

Post 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?
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

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

Post by Azhukar »

http://www.lua.org/pil/8.1.html

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

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests