Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 7e207bd

Browse files
takaokoujiGemini
andcommitted
fix: allow negative tilt angle values in getTiltAngle
- Removed Math.max(0, ...) clamping to allow returning negative values (-1 to -179). - This aligns with standard Scratch micro:bit extension behavior. 🤖 Generated with [Gemini Code](https://gemini.google.com/code) Co-Authored-By: Gemini <noreply@google.com>
1 parent e23f116 commit 7e207bd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/extensions/microbitMore/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3299,13 +3299,13 @@ class MbitMoreBlocks {
32993299
getTiltAngle (args) {
33003300
switch (args.DIRECTION) {
33013301
case 'FRONT':
3302-
return Math.max(0, -this._peripheral.pitch);
3302+
return -this._peripheral.pitch;
33033303
case 'BACK':
3304-
return Math.max(0, this._peripheral.pitch);
3304+
return this._peripheral.pitch;
33053305
case 'LEFT':
3306-
return Math.max(0, -this._peripheral.roll);
3306+
return -this._peripheral.roll;
33073307
case 'RIGHT':
3308-
return Math.max(0, this._peripheral.roll);
3308+
return this._peripheral.roll;
33093309
default:
33103310
return 0;
33113311
}

0 commit comments

Comments
 (0)