Accesing a file in a completely different area of the .love directory.
Posted: Sun Apr 23, 2017 9:34 pm
First things first: the order of my work folder.
What I am trying to do is access default.png from entity.lua. However, for the life of me, I can not figure out how.
Here's my current code; which currently doesn't work. As you can see, I have attempted to solve the issue by using the .. operator for lua. However, it doesn't work.
Any help would be appreciated!
What I am trying to do is access default.png from entity.lua. However, for the life of me, I can not figure out how.
Here's my current code; which currently doesn't work. As you can see, I have attempted to solve the issue by using the .. operator for lua. However, it doesn't work.
Code: Select all
Entity = Object:extend()
function Entity:new(img,x,y,xspeed,yspeed)
self.img = love.graphics.newImage('../../assets/sprites/default.png')
self.x = 0
self.y = 0
self.xspeed = 0
self.yspeed = 0
end
function Entity:update(dt)
end
function Entity:draw()
love.graphics.draw(img,x,y)
end