function love.load()
local me = love.graphics.newImage("me.png")
end
function love.draw()
local defaultx = 348
local defaulty = 300
local x = 348
local y = 600
love.graphics.print("Hello World!", x, y)
love.graphics.draw(me, defaultx, defaulty)
end
The "me" variable is local to love.load; that means it won't exist outside of that function. While using locals is good, and too many global variables can make for a tricky environment to develop in, having a variable with a wider scope isn't a bad thing. (In this case, easy solution: declare the variables like this:
at the top of your main.lua file, then use them as normal in the rest of the code without declaring them again; without the "local" keyword. That means the variables won't be global, but still be available to the whole file.)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics