This commit is contained in:
RandomityGuy 2024-06-30 11:34:04 +05:30
parent ec5662a835
commit 7fe505c6a8

View file

@ -21,6 +21,8 @@ class MovementInput {
public var value:Vector = new Vector(); public var value:Vector = new Vector();
var capturing = false;
var touchId = -1; var touchId = -1;
public function new() { public function new() {
@ -68,6 +70,7 @@ class MovementInput {
var stopped = false; var stopped = false;
capturing = true;
collider.startCapture((emove) -> { collider.startCapture((emove) -> {
if (e.touchId != emove.touchId) { if (e.touchId != emove.touchId) {
emove.propagate = true; emove.propagate = true;
@ -85,6 +88,7 @@ class MovementInput {
if (emove.kind == ERelease || emove.kind == EReleaseOutside) { if (emove.kind == ERelease || emove.kind == EReleaseOutside) {
stopped = true; stopped = true;
collider.stopCapture(); collider.stopCapture();
capturing = false;
} }
}, () -> { }, () -> {
if (stopped) { if (stopped) {
@ -92,6 +96,7 @@ class MovementInput {
this.joystick.graphics.alpha = 0; this.joystick.graphics.alpha = 0;
pressed = false; pressed = false;
capturing = false;
this.value = new Vector(0, 0); this.value = new Vector(0, 0);
} }
@ -127,7 +132,6 @@ class MovementInput {
} }
public function dispose() { public function dispose() {
this.collider.stopCapture();
this.area.dispose(); this.area.dispose();
} }
} }