From 3c7703ea44519554559eb128c661b2677797ed82 Mon Sep 17 00:00:00 2001 From: alestiago Date: Thu, 10 Mar 2022 17:05:55 +0000 Subject: [PATCH] refactor: removed _joint over joint --- lib/game/components/flipper.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/game/components/flipper.dart b/lib/game/components/flipper.dart index a68257f5..f30d2662 100644 --- a/lib/game/components/flipper.dart +++ b/lib/game/components/flipper.dart @@ -109,8 +109,6 @@ class Flipper extends PositionBodyComponent with KeyboardHandler { /// [onKeyEvent] method listens to when one of these keys is pressed. final List _keys; - late final RevoluteJoint _joint; - /// Applies downward linear velocity to the [Flipper], moving it to its /// resting position. void _moveDown() { @@ -147,13 +145,13 @@ class Flipper extends PositionBodyComponent with KeyboardHandler { ); // TODO(alestiago): Remove casting once the following is closed: // https://github.com/flame-engine/forge2d/issues/36 - _joint = world.createJoint(jointDef) as RevoluteJoint; + final joint = world.createJoint(jointDef) as RevoluteJoint; // FIXME(erickzanardo): when mounted the initial position is not fully // reached. unawaited( mounted.whenComplete( - () => FlipperAnchorRevoluteJointDef.unlock(_joint, side), + () => FlipperAnchorRevoluteJointDef.unlock(joint, side), ), ); }