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

Negative width in query rect #26

Closed
Bobbyjoness opened this issue Oct 13, 2016 · 2 comments
Closed

Negative width in query rect #26

Bobbyjoness opened this issue Oct 13, 2016 · 2 comments

Comments

@Bobbyjoness
Copy link

Hello, I'm using bump for a game and I'm having a small issue. I am trying to use queryRect to find enemies in my players attack range. The width I am sending to this function depends on the direction of the player which is a negative or positive 1 depending where the player is looking. When facing the positive direction queryRect works as expected but in the negative direction it fails silently. It doesn't even return the player. Idk if this is an intended feature or not. If it is, it would be helpful if queryRect errored when given invalid numbers.

@kikito
Copy link
Owner

kikito commented Oct 13, 2016

You are absolutely right, thanks for reporting.

For clarity reasons, all rectangles in bump are supposed to be "positive" (no negative height or width). This check is missing in queryRect. I will add it.

@kikito kikito closed this as completed in 3f56ab2 Oct 13, 2016
@kikito
Copy link
Owner

kikito commented Oct 13, 2016

Done! Thanks for creating this issue.

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