Skip to content

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

@sbj42

Description

@sbj42

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions