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

Let FieldOfViewMap support a map over an arbitrary rectangle, not just starting at 0,0 #2

Open
sbj42 opened this issue Jan 31, 2018 · 0 comments
Assignees

Comments

@sbj42
Copy link
Owner

sbj42 commented Jan 31, 2018

Let's add support for maps whose coordinates span an arbitrary rectangle. So you could have a map on, for example, (-20,-20)-(20,20) or (10000, 5000)-(10030, 5030). Basically we just need to use a Rectangle in FieldOfViewMap instead of a Size.

A possible interface would be:

const map = new FieldOfViewMap(-100, -50, 100, 100); // (x, y, w, h)
// map now ranges from (-100, -50) to (-1, 49)
map.addBody(-10, -30);

This shouldn't hurt performance, but it would help users avoid needing to map their own coordinates into a (0,0)-origin map space. See discussion in #1

@sbj42 sbj42 self-assigned this Jan 31, 2018
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

1 participant