Angel Garcia
Angel Garcia

Reputation: 1577

Trying to put lua scripts into folders. Love2D

Ok, so i've made a game using love2D and I tried converting it into a .app, because i'm running Mac OSX. But I got the error saying that main.lua needs to be that the top level of the .zip. So I tried putting all of my lua scripts into a folder leaving only the main.lua and the conf.lua in the top level of the .zip. But now love2D cannot find the other files in the folder. I tried putting the name of the directory when using "require." for instance:

    require "dir/player.lua"

but that wouldn't work...

Upvotes: 1

Views: 347

Answers (1)

pschulz
pschulz

Reputation: 1545

Use

require "dir.player"

The dot . denotes a parent level, the .lua is not needed.

Upvotes: 2

Related Questions