Improved pathing debug draw

This commit is contained in:
2019-10-25 13:56:54 -05:00
parent 9fcb7f3d6e
commit 202331474b
2 changed files with 18 additions and 9 deletions

View File

@@ -74,13 +74,17 @@ class IMICRTS
@path[@path_current_node]
end
def path_current_node_index
@path_current_node
end
def path_next_node
@path_current_node += 1
end
def at_current_path_node?(position)
def at_current_path_node?(entity)
if node = path_current_node
position.distance(node.tile.position) < @map.tile_size / 2
entity.position.distance(node.tile.position) <= @entity.radius
else
true
end