Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
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:
Post
by Robin » Thu Jan 27, 2011 5:52 pm
That might also explain why having a directory and a file with the same name + ".lua" fails. On the other hand, it might not.
kikito wrote: I mean, middleclass-extras has been already used in other .love files, hasn't it?
IIRC, I do it like this:
Code: Select all
/
main.lua
/middleclass-extras
/middleclass
kikito
Inner party member
Posts: 3153 Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:
Post
by kikito » Fri Jan 28, 2011 11:06 am
Mmm.
So what are the options?
Should I rename middleclass & middleclass-extras to something shorter ? I really like 'middleclass' It's got some punch.
The folder layout I'd prefer would be having middleclass-extras is inside middleclass; maybe calling its folder 'extras':
Code: Select all
middleclass/
|
+- middleclass.lua
+- LICENSE.txt
+- init.lua
`- extras/ -> middleclass-extras here
So the require would be
Code: Select all
require 'middleclass'
require 'middleclass.extras'
Or is there a flag that can be activated on physfs that prevents this from happening?
When I write def I mean function .
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Fri Jan 28, 2011 12:19 pm
Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
thelinx
The Strongest
Posts: 857 Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden
Post
by thelinx » Fri Jan 28, 2011 5:08 pm
Robin wrote: Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
No, it's "init.lua".
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Fri Jan 28, 2011 5:45 pm
thelinx wrote: Robin wrote: Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
No, it's "init.lua".
Never mind then.
TechnoCat
Inner party member
Posts: 1611 Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:
Post
by TechnoCat » Fri Jan 28, 2011 7:00 pm
No more talking in tongues __Init__.py
Users browsing this forum: Semrush [Bot] and 5 guests