Trouble adding pic"Could not open file" "Does not exist"

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Hockeystyle
Prole
Posts: 1
Joined: Sun Nov 23, 2014 12:54 am

Trouble adding pic"Could not open file" "Does not exist"

Post 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.

Image
Image
Image
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Trouble adding pic"Could not open file" "Does not exist"

Post by slime »

The image file needs to be in the same folder as your main.lua.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Trouble adding pic"Could not open file" "Does not exist"

Post 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
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 6 guests