I tried running this code but it says theres an error in main, line 4, y is a nil value.
I know C, so what am I doing wrong? Try running this code as your love.main
Code: Select all
function love.load()
screen = {}
screen.x = 100,
screen.y = 5,
screen.w = 600,
screen.h = 400,
msg = {}
msg.x = 0,
msg.y = 405,
msg.w = 800,
msg.h = 160,
face = {}
face.x = 5,
face.y = 5,
face.w = 96,
face.h = 96,
stat = {}
stat.x = 700,
stat.y = 5,
stat.w = 96,
stat.h = 400,
end
function love.update(dt)
end
function love.draw()
love.graphics.rectangle("line", screen.x, screen.y, screen.w, screen.h)
love.graphics.rectangle("line", msg.x, msg.y, msg.w, msg.h)
for i = 1, 4 do
love.graphics.rectangle("line", face.x, (i*face.y), face.w, face.h)
end
love.graphics.rectangle("line", stat.x, stat.y, stat.w, stat.h)
end