fixing a bunch of snippets

This commit is contained in:
Peli de Halleux
2018-01-18 16:43:16 -08:00
parent a60427e2cf
commit db4ed6daf3
20 changed files with 93 additions and 75 deletions

View File

@ -3,10 +3,10 @@
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Click, function () {
motors.largeBC.setSpeed(50)
sensors.touchSensor1.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch1.pauseUntil(TouchSensorEvent.Pressed)
motors.largeBC.setSpeed(0)
loops.pause(1000)
brick.setLight(LightsPattern.OrangeFlash)
brick.setLight(BrickLight.OrangeFlash)
motors.largeBC.setSpeed(-50)
loops.pause(2000)
motors.largeBC.setSpeed(0)

View File

@ -2,12 +2,12 @@
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Click, function () {
sensors.touchSensor1.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch1.pauseUntil(TouchSensorEvent.Pressed)
motors.largeBC.setSpeed(50)
sensors.touchSensor2.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch2.pauseUntil(TouchSensorEvent.Pressed)
motors.largeBC.setSpeed(0)
loops.pause(1000)
brick.setLight(LightsPattern.OrangeFlash)
brick.setLight(BrickLight.OrangeFlash)
motors.largeBC.setSpeed(-50)
loops.pause(2000)
motors.largeBC.setSpeed(0)

View File

@ -3,14 +3,14 @@
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Click, function () {
brick.showImage(images.eyesSleeping)
sensors.touchSensor1.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch1.pauseUntil(TouchSensorEvent.Pressed)
brick.showImage(images.eyesNeutral)
motors.largeBC.setSpeed(50)
sensors.touchSensor2.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch2.pauseUntil(TouchSensorEvent.Pressed)
brick.showImage(images.eyesTiredMiddle)
motors.largeBC.setSpeed(0)
loops.pause(1000)
brick.setLight(LightsPattern.OrangeFlash)
brick.setLight(BrickLight.OrangeFlash)
brick.showImage(images.eyesDizzy)
motors.largeBC.setSpeed(-50)
loops.pause(2000)

View File

@ -19,17 +19,13 @@ loops.pause(1000)
music.playSoundEffectUntilDone(sounds.communicationGo)
for (let d of drive) {
if (d == 1) {
motors.largeC.setSpeedFor(50, 360, MoveUnit.Degrees)
motors.largeC.pauseUntilReady()
motors.largeC.setSpeed(50, 360, MoveUnit.Degrees)
} else if (d == 3) {
motors.largeB.setSpeedFor(50, 360, MoveUnit.Degrees)
motors.largeB.pauseUntilReady()
motors.largeB.setSpeed(50, 360, MoveUnit.Degrees)
} else if (d == 4) {
motors.largeBC.setSpeedFor(50, 360, MoveUnit.Degrees)
motors.largeBC.pauseUntilReady()
motors.largeBC.setSpeed(50, 360, MoveUnit.Degrees)
} else {
motors.largeBC.setSpeedFor(-50, 360, MoveUnit.Degrees)
motors.largeBC.pauseUntilReady()
motors.largeBC.setSpeed(-50, 360, MoveUnit.Degrees)
}
}
music.playSoundEffectUntilDone(sounds.communicationGameOver)

View File

@ -23,17 +23,13 @@ loops.pause(1000)
music.playSoundEffectUntilDone(sounds.communicationGo)
for (let d of drive) {
if (d == 1) {
motors.largeC.setSpeedFor(50, 360, MoveUnit.Degrees)
motors.largeC.pauseUntilReady()
motors.largeC.setSpeed(50, 360, MoveUnit.Degrees)
} else if (d == 3) {
motors.largeB.setSpeedFor(50, 360, MoveUnit.Degrees)
motors.largeB.pauseUntilReady()
motors.largeB.setSpeed(50, 360, MoveUnit.Degrees)
} else if (d == 4) {
motors.largeBC.setSpeedFor(50, 360, MoveUnit.Degrees)
motors.largeBC.pauseUntilReady()
motors.largeBC.setSpeed(50, 360, MoveUnit.Degrees)
} else {
motors.largeBC.setSpeedFor(-50, 360, MoveUnit.Degrees)
motors.largeBC.pauseUntilReady()
motors.largeBC.setSpeed(-50, 360, MoveUnit.Degrees)
}
}
music.playSoundEffectUntilDone(sounds.communicationGameOver)