From 3bdb13f0496771d2850697b8ca33f46322bf74ef Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Tue, 29 Jan 2019 17:12:15 -0500 Subject: [PATCH] Rename and re-order freefall threshold constant --- src/extensions/scratch3_gdx_for/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/extensions/scratch3_gdx_for/index.js b/src/extensions/scratch3_gdx_for/index.js index bcbe9afe..0a1b2bee 100644 --- a/src/extensions/scratch3_gdx_for/index.js +++ b/src/extensions/scratch3_gdx_for/index.js @@ -49,18 +49,18 @@ const SHAKEN_THRESHOLD = 30; */ const FACING_THRESHOLD = 9; +/** + * Threshold for acceleration magnitude, below which we are in freefall. + * @type {number} + */ +const FREEFALL_THRESHOLD = 0.5; + /** * Acceleration due to gravity, in m/s^2. * @type {number} */ const GRAVITY = 9.8; -/** - * Threshold for acceleration magnitude, below which we are in freefall. - * @type {number} - */ -const FREEFALL = 0.5; - /** * Manage communication with a GDX-FOR peripheral over a Scratch Link client socket. */ @@ -769,7 +769,7 @@ class Scratch3GdxForBlocks { } isFreeFalling () { - return this.accelMagnitude() < FREEFALL; + return this.accelMagnitude() < FREEFALL_THRESHOLD; } }