some changes, idr, hehe sorry

This commit is contained in:
0x81c 2015-03-15 05:26:47 -04:00
parent c668dc513b
commit b553d3f664
5 changed files with 116 additions and 48 deletions

View file

@ -8,6 +8,12 @@ function Entity:initialize(t)
self.collision = t.collision --"none", "moveable", "unmoveable"
self.sprite = t.sprite
self.shaAmount = t.sha or 1
self.drawOffset = {x = 0, y = 0}
if self.size.w < 1 or self.size.h < 1 then
self.drawOffset.x = (drawScale * 16 * self.size.w) / 2
self.drawOffset.y = (drawScale * 16 * self.size.h) / 2
end
end
function Entity:getCollision()
@ -70,7 +76,7 @@ end
function Entity:draw()
love.graphics.setColor(self.color:set())
local p = self:getDrawPos()
love.graphics.draw(self.sprite, p.x, p.y, 0, drawScale, drawScale)
love.graphics.draw(self.sprite, p.x + self.drawOffset.x, p.y + self.drawOffset.y, 0, drawScale, drawScale)
end
function Entity:canMove()