mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
BoostMotor.power(value) now sets to 0 if value is 0 rather than scaling, to ensure that blocks skip immediately if speed set to 0
This commit is contained in:
parent
75fc37aa30
commit
b2c18e9dcd
1 changed files with 5 additions and 3 deletions
|
@ -372,9 +372,11 @@ class BoostMotor {
|
||||||
* Scale the motor power to a range between 10 and 100,
|
* Scale the motor power to a range between 10 and 100,
|
||||||
* to make sure the motors will run with something built onto them.
|
* to make sure the motors will run with something built onto them.
|
||||||
*/
|
*/
|
||||||
const p = MathUtil.scale(value, 0, 100, 10, 100);
|
if (value === 0) {
|
||||||
|
this._power = 0;
|
||||||
this._power = p;
|
} else {
|
||||||
|
this._power = MathUtil.scale(value, 1, 100, 10, 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue