basic stuff w movemet n collision done
This commit is contained in:
parent
662de9407a
commit
fe21cb61e3
1 changed files with 4 additions and 1 deletions
5
room.lua
5
room.lua
|
|
@ -137,6 +137,8 @@ function Room:getAdjacentEntities(entities, pos, axis, direction)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
shallowTablePrint(t)
|
||||||
|
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -164,10 +166,11 @@ function Room:tryPlayerMove(entities, pos, axis, direction)
|
||||||
for _, entity in ipairs(entities) do
|
for _, entity in ipairs(entities) do
|
||||||
pos[axis] = pos[axis] + direction
|
pos[axis] = pos[axis] + direction
|
||||||
if entity:atGridPos(pos.x, pos.y) then
|
if entity:atGridPos(pos.x, pos.y) then
|
||||||
print("HOW????")
|
print("HOW????" .. entity)
|
||||||
if entity:canMove() then
|
if entity:canMove() then
|
||||||
table.insert(entitiesToMove, entity)
|
table.insert(entitiesToMove, entity)
|
||||||
else
|
else
|
||||||
|
print(entity)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue