hexus / phaser-arcade-slopes

:triangular_ruler: A Phaser CE plugin that brings sloped tile collision handling to the Arcade Physics engine
MIT License
126 stars 16 forks source link

Added missing touching flags. #19

Closed IkonOne closed 7 years ago

IkonOne commented 7 years ago

Not all flags were being updated in the Body class.

hexus commented 7 years ago

Ah, thanks very much. :+1:

It's obvious here that I'm biased towards using .touching to mean literally touching (just separated from collision or next to something, so the same as wasTouching), rather than just overlapping.

I must have assumed at the time that touching.none was dynamic, but of course touching is just a simple object full of booleans, and I had totally forgot about wasTouching.

IkonOne commented 7 years ago

My pleasure!

On Wed, Aug 24, 2016 at 4:23 AM, Chris Andrew notifications@github.com wrote:

Merged #19 https://github.com/hexus/phaser-arcade-slopes/pull/19.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hexus/phaser-arcade-slopes/pull/19#event-765706225, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDe7vN1aqZFkXz6-NZ01n2kqePbcrVHks5qjA2ngaJpZM4JrSE- .

hexus commented 7 years ago

Turns out setting the wasTouching flags on collision is incorrect, as this is already handled by the body's preUpdate() method.

So, setting them here is just ensuring that they'll always be false, because the body's preUpdate() sets all touching flags to false.