Buttons rename (#287)

* renaming up/down/click to released/pressed/bump

* missing images

* fixing signature issue

* updated strings

* white lego logo
This commit is contained in:
Peli de Halleux
2018-01-31 08:28:00 -08:00
committed by GitHub
parent ba1b9a54b4
commit ea956f1a73
50 changed files with 151 additions and 102 deletions

View File

@ -111,7 +111,7 @@ function stop() {
motors.stopAllMotors()
state = 0
moods.knockedOut.show();
sensors.touch3.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch3.pauseUntil(ButtonEvent.Pressed)
moods.neutral.show();
}
sensors.ultrasonic4.onEvent(UltrasonicSensorEvent.ObjectNear, function () {

View File

@ -149,7 +149,7 @@ loops.forever(function () {
brick.setLight(BrickLight.RedPulse);
brick.showImage(images.eyesKnockedOut)
music.playSoundEffect(sounds.movementsSpeedDown)
sensors.touch3.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch3.pauseUntil(ButtonEvent.Pressed)
brick.setLight(BrickLight.Off);
})

View File

@ -11,7 +11,7 @@ function INI() {
motors.mediumA.setSpeed(30, 1, MoveUnit.Seconds);
motors.mediumA.setSpeed(-50, 90, MoveUnit.Degrees);
motors.largeC.setSpeed(50)
sensors.touch1.pauseUntil(TouchSensorEvent.Pressed);
sensors.touch1.pauseUntil(ButtonEvent.Pressed);
motors.largeC.setSpeed(-50, 0.86, MoveUnit.Rotations);
}

View File

@ -11,7 +11,7 @@ function INI() {
motors.mediumA.setSpeed(30, 1, MoveUnit.Seconds);
motors.mediumA.setSpeed(-50, 90, MoveUnit.Degrees);
motors.largeC.setSpeed(50)
sensors.touch1.pauseUntil(TouchSensorEvent.Pressed);
sensors.touch1.pauseUntil(ButtonEvent.Pressed);
motors.largeC.setSpeed(-50, 0.86, MoveUnit.Rotations);
}

View File

@ -149,7 +149,7 @@ loops.forever(function () {
brick.setLight(BrickLight.RedPulse);
brick.showImage(images.eyesKnockedOut)
music.playSoundEffect(sounds.movementsSpeedDown)
sensors.touch3.pauseUntil(TouchSensorEvent.Pressed)
sensors.touch3.pauseUntil(ButtonEvent.Pressed)
brick.setLight(BrickLight.Off);
})

View File

@ -3,10 +3,10 @@
Use a touch sensor to make the brick happy.
```blocks
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
brick.showImage(images.expressionsBigSmile)
})
sensors.touch1.onEvent(TouchSensorEvent.Released, function () {
sensors.touch1.onEvent(ButtonEvent.Released, function () {
brick.showImage(images.expressionsSick)
})
```

View File

@ -44,7 +44,7 @@ loops.forever(function () {
lasterror = error
if (brick.buttonEnter.wasPressed()) {
motors.largeBC.setSpeed(0)
brick.buttonDown.pauseUntil(ButtonEvent.Click)
brick.buttonDown.pauseUntil(ButtonEvent.Bumped)
}
})
```