id_
This commit is contained in:
parent
b19f58726c
commit
01d272981e
133 changed files with 822 additions and 66 deletions
11
entity.lua
11
entity.lua
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue