mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -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.
|
* @param {boolean} [resetState=true] - whether to reset the state of the motor when running this command.
|
||||||
*/
|
*/
|
||||||
turnOnFor (milliseconds, resetState = true) {
|
turnOnFor (milliseconds, resetState = true) {
|
||||||
if (this.power === 0) return;
|
if (this.power === 0) {
|
||||||
|
this.turnOff(false);
|
||||||
|
}
|
||||||
|
|
||||||
milliseconds = Math.max(0, milliseconds);
|
milliseconds = Math.max(0, milliseconds);
|
||||||
if (resetState) this.status = BoostMotorState.ON_FOR_TIME;
|
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.
|
* @param {boolean} [resetState=true] - whether to reset the state of the motor when running this command.
|
||||||
*/
|
*/
|
||||||
turnOnForDegrees (degrees, direction, resetState = true) {
|
turnOnForDegrees (degrees, direction, resetState = true) {
|
||||||
if (this.power === 0) {
|
/* if (this.power === 0) {
|
||||||
this._clearRotationState();
|
this._clearRotationState();
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
degrees = Math.max(0, degrees);
|
degrees = Math.max(0, degrees);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue