Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. func makePathBase(position):
  2. position = Vector3(position.x, position.y, 0)
  3. var baseId
  4. var enemyId
  5. var basePosition = Vector3(get_node("base").get_global_pos().x, get_node("base").get_global_pos().y, 0)
  6. for i in range(0, columns * rows, 1):
  7. if baseId != null and enemyId != null:
  8. break
  9. if graph.get_point_pos(i) == position:
  10. enemyId = i
  11. if graph.get_point_pos(i) == basePosition:
  12. baseId = i
  13. print(baseId)
  14. return graph.get_point_path(enemyId, baseId)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement