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 .
RBXcpmoderator12345
Citizen
Posts: 59 Joined: Sat Mar 07, 2015 11:53 pm
Post
by RBXcpmoderator12345 » Thu Dec 03, 2015 6:18 am
My code in main.lua is:
Code: Select all
levelprocessor = require "levelprocessor.lua"
function love.load()
healthbar = love.graphics.newImage("ui/Untitled.png")
good_health = love.graphics.newQuad(0, 0, 100, 36, healthbar:getDimensions())
caution_health = love.graphics.newQuad(100,36,102, 36, healthbar:getDimensions())
warning_health = love.graphics.newQuad(102,36,204,36,healthbar:getDimensions())
grass_top_singular = love.graphics.newImage("blocks/grassdirt/grass.png")
end
function love.draw()
love.graphics.draw(grass_top_singular, 0,568,0,2,2);
levelprocessor.processFile("level1.lua")
end
The error is too large to show here, so I will make a .love of this.
Attachments
newgame.love
(2.26 MiB) Downloaded 89 times
slime
Solid Snayke
Posts: 3159 Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:
Post
by slime » Thu Dec 03, 2015 6:38 am
Require's argument needs to be a module name without the .lua extension (and preferably with . instead of / if it's in a directory), so if you do require "levelprocessor" instead of require "levelprocessor.lua" it should work.
RBXcpmoderator12345
Citizen
Posts: 59 Joined: Sat Mar 07, 2015 11:53 pm
Post
by RBXcpmoderator12345 » Thu Dec 03, 2015 7:27 pm
Nevermind, solved it
turns out my module didn't return any functions, that is why it returned nil
Users browsing this forum: No registered users and 2 guests