This commit is contained in:
0x81c 2015-03-25 01:38:53 -04:00 committed by Your Name
parent b19f58726c
commit 01d272981e
133 changed files with 822 additions and 66 deletions

View file

@ -46,6 +46,8 @@ function Entity:getOccupiedCells(coords)
adjustedCell.y = pos.y + cell.y - 1 + offset.y
table.insert(cells, adjustedCell)
end
-- print("cels!!!!", cells[1].x, cells[1].y)
return cells
end
@ -89,6 +91,15 @@ function Entity:getGridSize()
return {x = self.size.w, y = self.size.h}
end
function Entity:occupiesCell(inCell)
for _, cell in pairs(self:getOccupiedCells()) do
if cell.x == inCell.x and cell.y == inCell.y then
return true
end
end
return false
end
function Entity:getname()
return self.name
end