mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Correct the trigger of isTilted()
This commit is contained in:
parent
772fbe1aab
commit
71631f5aa2
1 changed files with 2 additions and 2 deletions
|
@ -1543,8 +1543,8 @@ class Scratch3WeDo2Blocks {
|
||||||
_isTilted (direction) {
|
_isTilted (direction) {
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case WeDo2TiltDirection.ANY:
|
case WeDo2TiltDirection.ANY:
|
||||||
return (Math.abs(this._peripheral.tiltX) >= Scratch3WeDo2Blocks.TILT_THRESHOLD) ||
|
return (this._peripheral.tiltX > 45 ? 256 - this._peripheral.tiltX : this._peripheral.tiltX) >= Scratch3WeDo2Blocks.TILT_THRESHOLD ||
|
||||||
(Math.abs(this._peripheral.tiltY) >= Scratch3WeDo2Blocks.TILT_THRESHOLD);
|
(this._peripheral.tiltY > 45 ? 256 - this._peripheral.tiltY : this._peripheral.tiltY) >= Scratch3WeDo2Blocks.TILT_THRESHOLD;
|
||||||
default:
|
default:
|
||||||
return this._getTiltAngle(direction) >= Scratch3WeDo2Blocks.TILT_THRESHOLD;
|
return this._getTiltAngle(direction) >= Scratch3WeDo2Blocks.TILT_THRESHOLD;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue