Images
Posted: Wed Aug 10, 2022 10:07 pm
How do i put images in my thing (not game yet), i make sure the name is right and... i'm not very sure about the code, here is it
Error
main.lua:5: Could not open file frame_up.png. Does not exist.
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'newImage'
main.lua:5: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'
Code: Select all
function love.load()
x = 0
y = 0
mv = 10
slime = love.graphics.newImage("frame_up.png")
end
function love.draw()
love.graphics.draw("slime", x, y)
end
function love.update()
if x > 600 then
x = x - mv
end
if y > 400 then
y = y - mv
end
if x < 0 then
x = x + mv
end
if y < 0 then
y = y + mv
end
if love.keyboard.isDown("d") then
x = x + mv
end
if love.keyboard.isDown("s") then
y = y + mv
end
if love.keyboard.isDown("a") then
x = x - mv
end
if love.keyboard.isDown("w") then
y = y - mv
end
end
it gives me this error
main.lua:5: Could not open file frame_up.png. Does not exist.
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'newImage'
main.lua:5: in function 'load'
[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
[C]: in function 'xpcall'
[C]: in function 'xpcall'