toreit out git add -A
This commit is contained in:
parent
2f40eaf000
commit
3ae6c416e5
2 changed files with 4 additions and 109 deletions
13
entity.lua
13
entity.lua
|
|
@ -24,6 +24,10 @@ function Entity:getDrawBox()
|
|||
return {x = drawPos.x, y = drawPos.y, w = self.spriteSize.w * drawScale, h = self.spriteSize.h * drawScale}
|
||||
end
|
||||
|
||||
function Entity:getGridBox()
|
||||
return {x = self.x, y = self.y, w = self.size.w, h = self.size.h}
|
||||
end
|
||||
|
||||
function Entity:getGridPos()
|
||||
return {x = self.x, y = self.y}
|
||||
end
|
||||
|
|
@ -50,15 +54,6 @@ function Entity:draw()
|
|||
love.graphics.draw(self.sprite, p.x, p.y, 0, drawScale, drawScale)
|
||||
end
|
||||
|
||||
function Entity:isAlignedWithPlayerMovement(axis, pos, direction)
|
||||
-- print(axis, pos[axis], self:getGridPos()[axis], self:getGridPos()[axis] + self.size[axis])
|
||||
if self:getGridPos()[axis] <= pos[axis] and self:getGridPos()[axis] + self:getGridSize()[axis] > pos[axis] then
|
||||
print("true!!")
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function Entity:canMove()
|
||||
if self.collision == "unmoveable" then
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue