diff --git a/src/extensions/scratch3_wedo2/index.js b/src/extensions/scratch3_wedo2/index.js index e34d51a45..ce6050cf9 100644 --- a/src/extensions/scratch3_wedo2/index.js +++ b/src/extensions/scratch3_wedo2/index.js @@ -1543,8 +1543,8 @@ class Scratch3WeDo2Blocks { _isTilted (direction) { switch (direction) { case WeDo2TiltDirection.ANY: - return (Math.abs(this._peripheral.tiltX) >= Scratch3WeDo2Blocks.TILT_THRESHOLD) || - (Math.abs(this._peripheral.tiltY) >= Scratch3WeDo2Blocks.TILT_THRESHOLD); + return (this._peripheral.tiltX > 45 ? 256 - this._peripheral.tiltX : this._peripheral.tiltX) >= Scratch3WeDo2Blocks.TILT_THRESHOLD || + (this._peripheral.tiltY > 45 ? 256 - this._peripheral.tiltY : this._peripheral.tiltY) >= Scratch3WeDo2Blocks.TILT_THRESHOLD; default: return this._getTiltAngle(direction) >= Scratch3WeDo2Blocks.TILT_THRESHOLD; }