mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Playing with power states while we figure out the design.
This commit is contained in:
parent
597bd68c0d
commit
270a445703
1 changed files with 5 additions and 3 deletions
|
@ -510,7 +510,9 @@ class BoostMotor {
|
|||
* @param {boolean} [resetState=true] - whether to reset the state of the motor when running this command.
|
||||
*/
|
||||
turnOnFor (milliseconds, resetState = true) {
|
||||
if (this.power === 0) return;
|
||||
if (this.power === 0) {
|
||||
this.turnOff(false);
|
||||
}
|
||||
|
||||
milliseconds = Math.max(0, milliseconds);
|
||||
if (resetState) this.status = BoostMotorState.ON_FOR_TIME;
|
||||
|
@ -525,10 +527,10 @@ class BoostMotor {
|
|||
* @param {boolean} [resetState=true] - whether to reset the state of the motor when running this command.
|
||||
*/
|
||||
turnOnForDegrees (degrees, direction, resetState = true) {
|
||||
if (this.power === 0) {
|
||||
/* if (this.power === 0) {
|
||||
this._clearRotationState();
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
degrees = Math.max(0, degrees);
|
||||
|
||||
|
|
Loading…
Reference in a new issue