Page 1 of 1
Trouble adding pic"Could not open file" "Does not exist"
Posted: Sun Nov 23, 2014 1:02 am
by Hockeystyle
First of all I am completely new to LOVE and Lua, so if I make any stupid mistakes then please bear with me but here is my trouble:
I have been trying to add this picture in my game so I can use it to move around but every time I try to it says that the file does not exist despite the fact the picture does exist.
Re: Trouble adding pic"Could not open file" "Does not exist"
Posted: Sun Nov 23, 2014 1:54 am
by slime
The image file needs to be in the same folder as your main.lua.
Re: Trouble adding pic"Could not open file" "Does not exist"
Posted: Sun Nov 23, 2014 2:54 am
by Positive07
Also in your code you define love.load twice, this means that you are over-writing it.
This part of your code wont be executed ever:
Code: Select all
function love.load ()
love.graphics.setNewFont(12)--This is the default font so this part is rather pointless
love.graphics.setColor(0,0,0)
love.graphics.setBackgroundColor(255,255,255)
end
You must define the functions once, so you could combine your code and do something like this
Code: Select all
function love.load ()
love.graphics.setNewFont(12)--This is the default font so this part is rather pointless
love.graphics.setColor(0,0,0)
love.graphics.setBackgroundColor(255,255,255)
Ryladine = love.graphics.newImage("Ryladine.png")
x = 50
y = 50
speed = 300
end