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