Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question #45

Closed
MAYasin opened this issue Apr 6, 2021 · 1 comment
Closed

Question #45

MAYasin opened this issue Apr 6, 2021 · 1 comment

Comments

@MAYasin
Copy link

MAYasin commented Apr 6, 2021

Just a question, would like to know how to convert the edges to a position like a coordinate system (X, Y). I am working on a game that uses angles as a direction (the map is like a graph) that my player uses to move. Having the position of the edges would be really helpful.
Should I create more nodes to store my obstacles?
Sample code usage of this library would be really helpful.

@roy-t
Copy link
Owner

roy-t commented Apr 6, 2021

Hey MAYasin,

I'm not sure if I follow. Each node has a position property which gives the position of the node. Or are you using the Grid class to generate a grid of connected nodes? In that case you should map the 'abstract' location of a node (for example {1, 1}) to a physical location like, New York or {1254.42f, 41.2f} in your own code using a mapping function.

Alternatively you can also generate the nodes yourself so you can use the position property.

You can take a look at the viewer or the tests if you want more sample code to study the library.

Does that help? (Closing for now, please re-open if you have more questions)

@roy-t roy-t closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants