some changes, idr, hehe sorry
This commit is contained in:
parent
c668dc513b
commit
b553d3f664
5 changed files with 116 additions and 48 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue