basic stuff w movemet n collision done

This commit is contained in:
0x81c 2015-03-12 05:21:24 -04:00
parent 662de9407a
commit fe21cb61e3

View file

@ -137,6 +137,8 @@ function Room:getAdjacentEntities(entities, pos, axis, direction)
end
end)
shallowTablePrint(t)
return t
end
@ -164,10 +166,11 @@ function Room:tryPlayerMove(entities, pos, axis, direction)
for _, entity in ipairs(entities) do
pos[axis] = pos[axis] + direction
if entity:atGridPos(pos.x, pos.y) then
print("HOW????")
print("HOW????" .. entity)
if entity:canMove() then
table.insert(entitiesToMove, entity)
else
print(entity)
return false
end
else