Error
main.lua:2:module 'entities.lua' not found:
no file "entities/lua.lua" in LOVE paths.
no extension "entities.lua" in LOVE paths.
no field package.preload['entities.lua']
no file '.\entities\lua'
no file 'C:\Program Files\LOVE\lua\entities\lua.lua'
no file 'C:\Program Files\LOVE\lua\entities\init.lua'
no file 'C:\Program Files\LOVE\entities\lua.lua'
no file 'C:\Program Files\LOVE\entities\init.lua'
no file '.\entities\lua.dll'
no file 'C:\Program Files\LOVE\entities\lua.dll'
no file 'C:\Program Files\LOVE\loadall.dll'
no file '.\entities.dll'
no file 'C:\Program Files\LOVE\entities.dll'
no file 'C:\Program Files\LOVE\loadall.dll'
Traceback
[C]: in function 'require'
main.lua:2: in function 'load'
[C]: in function 'xpcall'
My main.lua code:
Code: Select all
function love.load()
require("entities.lua")
xCloud1 = 0
xCloud2 = 100
imageCloud = love.graphics.newImage("textures/cloud.png")
imageGround = love.graphics.newImage("textures/ground.png")
imageEnemy_1 = love.graphics.newImage("textures/enemy1.png")
imageEnemy_2 = love.graphics.newImage("textures/enemy2.png")
end
function love.draw()
-- Draws Rectangle that is assiciating with grass
love.graphics.setColor( 103, 164, 21, 255 )
love.graphics.rectangle("fill",0, 392, 800, 392 )
-- Draws Rectangle who is assiciating with sky
love.graphics.setColor(0,192,255,255)
love.graphics.rectangle("fill",0,0,800,408)
--Draws cloud1
love.graphics.setColor(255,255,255,255)
love.graphics.draw(imageCloud, xCloud1 - 200, 128, 0,1,1,0,0)
--Draws cloud2
love.graphics.setColor(255,255,255,255)
love.graphics.draw(imageCloud, xCloud2 - 200,256,0,1,1,0,0)
-- Draws Meldon land words in X: 32 Y: 32
love.graphics.setColor(0,0,0,255)
love.graphics.print("Meldon Land",32,32,0,1,1)
--Draws Upper grass
love.graphics.setColor(255,255,255,255)
love.graphics.draw( imageGround, (800-1024)/2, 408-64, 0, 1, 1, 0, 0 )
end
function love.update(dt)
xCloud1 = xCloud1 + 60*dt
if xCloud1 >= (800 + 200) then
xCloud1 = 0
end
xCloud2 = xCloud2 + 48*dt
if xCloud2 >= (800+200) then
xCloud2 = 0
end
end
function love.focus(bool)
end
function love.keypressed( key, unicode )
if key == "escape" then
love.event.push("quit") -- actually causes the app to quit
end
end
function love.keyreleased( key, unicode )
end
function love.mousepressed( x, y, button )
print("X: " .. x,"Y: " .. y)
end
function love.mousereleased( x, y, button )
end
function love.quit()
end
My entities.lua code:
ents = {}
ents.objects = {}
ents.objpath = "entities/"
local register = {}
local id = 0
function ents.Startup()
end
function ents.Create(name, x, y)
if not x then
x = 0
end
if not y then
y = 0
end
if register(name) then
id = id +1
local ent = register[name]()
ent:load()
ent.setPos(x, y)
ent.id = id
ents.objects[#ents.obejcts + 1] = ent
return ents.objects[#ents.objects]
else
print("ERROR! Entity name does not exists")
return false;
end
So please help me. I really want to continue developing games with Love2D