Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func makePathBase(position):
- position = Vector3(position.x, position.y, 0)
- var baseId
- var enemyId
- var basePosition = Vector3(get_node("base").get_global_pos().x, get_node("base").get_global_pos().y, 0)
- for i in range(0, columns * rows, 1):
- if baseId != null and enemyId != null:
- break
- if graph.get_point_pos(i) == position:
- enemyId = i
- if graph.get_point_pos(i) == basePosition:
- baseId = i
- print(baseId)
- return graph.get_point_path(enemyId, baseId)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement