mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-14 14:30:34 -04:00
Merge ba32baa3c6
into f207757ef0
This commit is contained in:
commit
7cf372148f
1 changed files with 5 additions and 1 deletions
|
@ -1375,7 +1375,11 @@ class Scratch3WeDo2Blocks {
|
|||
this._forEachMotor(args.MOTOR_ID, motorIndex => {
|
||||
const motor = this._peripheral.motor(motorIndex);
|
||||
if (motor) {
|
||||
motor.power = MathUtil.clamp(Cast.toNumber(args.POWER), 0, 100);
|
||||
const power = MathUtil.clamp(Cast.toNumber(args.POWER), 0, 100);
|
||||
if (power === 0) {
|
||||
motor.turnOff();
|
||||
}
|
||||
motor.power = power;
|
||||
motor.turnOn();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue