From 4063b5aac86cc31598180f96d0e8990faaf61f9b Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Wed, 8 Jun 2016 16:59:20 -0700 Subject: [PATCH] Rewrote in simple language. Deleted redundant material. --- docs/reference/input/on-gesture.md | 33 +++++++----------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/docs/reference/input/on-gesture.md b/docs/reference/input/on-gesture.md index d841169a..fbe39946 100644 --- a/docs/reference/input/on-gesture.md +++ b/docs/reference/input/on-gesture.md @@ -1,19 +1,17 @@ # On Gesture -Register an [event handler](/reference/event-handler) that will execute whenever the user executes a gesture withthe BBC micro:bit. +Start an [event handler](/reference/event-handler) (part of the +program that will run when something happens) This handler works when +you do a **gesture** (like shake, tilt, or drop the micro:bit). ```sig input.onGesture(Gesture.Shake,() => { }) ``` -## Gestures +## Example: random number - - -### Example: random number - -The following example displays a number from 0-9 on the screen when you shake the BBC micro:bit. +This program shows a number from `0` to `9` when you shake the micro:bit. ```blocks input.onGesture(Gesture.Shake,() => { @@ -22,24 +20,7 @@ input.onGesture(Gesture.Shake,() => { }) ``` -### Example: rock, paper, scissors +## Lessons -The following example shows one of three images (rock, paper, or scissors) when you shake the BBC micro:bit. - -```blocks -input.onGesture(Gesture.Shake,() => { - let img = images.createImage(` -. . . . . # # # # # . . . . # -. # # # . # . . . # # # . # . -. # # # . # . . . # . # # . . -. # # # . # . . . # # # . # . -. . . . . # # # # # . . . . # -`) - img.showFrame(Math.random(3)) -}) -``` - -### Lessons - -[bounce image](/lessons/bounce-image), [rock paper scissors](/lessons/rock-paper-scissors) +[bounce image](/lessons/bounce-image)