From 1c2e15ac9816b15e19efd380d898883a7e1bfb05 Mon Sep 17 00:00:00 2001 From: samme Date: Tue, 7 Jul 2020 11:31:54 -0700 Subject: [PATCH] Update _dx and _dy during friction movement --- src/physics/arcade/SeparateX.js | 2 ++ src/physics/arcade/SeparateY.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/physics/arcade/SeparateX.js b/src/physics/arcade/SeparateX.js index 35b7d2acf..976b50cb3 100644 --- a/src/physics/arcade/SeparateX.js +++ b/src/physics/arcade/SeparateX.js @@ -64,6 +64,7 @@ var SeparateX = function (body1, body2, overlapOnly, bias) if (body2.moves) { body1.y += (body2.y - body2.prev.y) * body2.friction.y; + body1._dy = body1.y - body1.prev.y; } } else @@ -75,6 +76,7 @@ var SeparateX = function (body1, body2, overlapOnly, bias) if (body1.moves) { body2.y += (body1.y - body1.prev.y) * body1.friction.y; + body2._dy = body2.y - body2.prev.y; } } diff --git a/src/physics/arcade/SeparateY.js b/src/physics/arcade/SeparateY.js index 12b153715..fd8612dc1 100644 --- a/src/physics/arcade/SeparateY.js +++ b/src/physics/arcade/SeparateY.js @@ -64,6 +64,7 @@ var SeparateY = function (body1, body2, overlapOnly, bias) if (body2.moves) { body1.x += (body2.x - body2.prev.x) * body2.friction.x; + body1._dx = body1.x - body1.prev.x; } } else @@ -75,6 +76,7 @@ var SeparateY = function (body1, body2, overlapOnly, bias) if (body1.moves) { body2.x += (body1.x - body1.prev.x) * body1.friction.x; + body2._dx = body2.x - body2.prev.x; } }