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

Fix skipped collisions between tiles #38

Closed hexus closed 7 years ago

hexus commented 7 years ago

There's an issue with heuristics that skip collisions between tiles.

Small enough objects can slip between tiles, as seen here:

https://github.com/photonstorm/phaser-ce/issues/94#issuecomment-290867117

Reproduce and fix the hell out of it without touching SAT.js for the time being.

This is related to #36. Disabling heuristics fixes the issue so that's likely where the it lies.

hexus commented 7 years ago

Try adding heuristics for the square tiles too, as absurd as it might seem.

You'll probably need to allow returning the preferred separation axis from heuristics callbacks, to handle each edge case (literal edges... in this case... oh).

hexus commented 7 years ago

This is fixed for square tiles.

image

Let's see what we can do about slope seams next. Again, it only seems (hah) to affect bodies that are particularly small relative to the tile.

image

hexus commented 7 years ago

Covered most cases, but edge cases include entering and exiting square tiles at diagonals. This isn't really the right solution, but it helps. We can wait for 0.3.0 for the real fix.

This will do for now.