Here's the code causing the issue, and after that is the .love file, which has a bunch of stuff in it including STI, bump, anim8, an implementation of A* i'm not currently using, etc. Just head to main.lua in the main folder.
Code: Select all
function slayer:draw()
local dx,dy = 0,0
local qx,qy = math.floor((self.player.x - (love.graphics.getWidth() / 2))/16),math.floor((self.player.y - (love.graphics.getHeight() / 2))/16)
local hx, hy = math.floor((self.player.x + (love.graphics.getWidth() / 2)) / 16), math.floor((self.player.y + (love.graphics.getHeight() / 2)) / 16)
love.graphics.setCanvas(self.visibleImage)
repeat
if has_val(self.player.visible,{['x'] = qx, ['y'] = qy}) then
love.graphics.setColor(255,255,255,0)
love.graphics.points(dx,dy)
else
love.graphics.setColor(0,0,0,128)
love.graphics.points(dx,dy)
end
qy = qy + 1
dy = dy + 1
if qy > hy then
qy = 1
dy = 1
qx = qx + 1
dx = dx + 1
end
until qx == hx and qy == hy
love.graphics.setColor(255,255,255,255)
love.graphics.setCanvas()
love.graphics.draw(self.visibleImage,(self.player.x - (love.graphics.getWidth() / 2)),(self.player.y - (love.graphics.getHeight() / 2)),0,16,16)
self.player.anims[self.player.currentAnim]:draw(
plsprite,
math.floor(self.player.x),
math.floor(self.player.y),
0,2,2,
self.player.ox,
self.player.oy)
end