Change boundary check #2

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@kjirou
kjirou commented Jan 3, 2017

I felt it was strange that this result would be true.

> collide({ left: 0, right: 3, top: 0, bottom: 2 }, { left: 3, right: 5, top: 0, bottom: 2 })
true

When I express it in the diagram...

+-+-+-+-+-+-+-+-+ o = { left: 0, right: 3, top: 0, bottom: 2 }
|o|o|o|x|x| | | | x = { left: 3, right: 5, top: 0, bottom: 2 }
+-+-+-+-+-+-+-+-+
|o|o|o|x|x| | | |
+-+-+-+-+-+-+-+-+
| | | | | | | | |
+-+-+-+-+-+-+-+-+

...I think that this is not a conflict?

Thanks

@veego
veego commented Jan 21, 2017

It's no conflict, it's collision. It's working as expected, when you develop a game and two characters (or character and wall) meets, then collision happened. You don't want player to walk inside wall isn't.

@kjirou
kjirou commented Jan 21, 2017

@veego I thought that opinion was correct.
Thank you very much.

@kjirou kjirou closed this Jan 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment