From a2b2dabfe685ec5af41dc79f0cde8946a0727631 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Sun, 30 Jun 2024 11:34:04 +0530 Subject: [PATCH] ew --- src/touch/MovementInput.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/touch/MovementInput.hx b/src/touch/MovementInput.hx index 891c4ff1..c7949840 100644 --- a/src/touch/MovementInput.hx +++ b/src/touch/MovementInput.hx @@ -21,6 +21,8 @@ class MovementInput { public var value:Vector = new Vector(); + var capturing = false; + var touchId = -1; public function new() { @@ -68,6 +70,7 @@ class MovementInput { var stopped = false; + capturing = true; collider.startCapture((emove) -> { if (e.touchId != emove.touchId) { emove.propagate = true; @@ -85,6 +88,7 @@ class MovementInput { if (emove.kind == ERelease || emove.kind == EReleaseOutside) { stopped = true; collider.stopCapture(); + capturing = false; } }, () -> { if (stopped) { @@ -92,6 +96,7 @@ class MovementInput { this.joystick.graphics.alpha = 0; pressed = false; + capturing = false; this.value = new Vector(0, 0); } @@ -127,7 +132,6 @@ class MovementInput { } public function dispose() { - this.collider.stopCapture(); this.area.dispose(); } }