Migrate docs from the other repo

This commit is contained in:
Michal Moskal committed 2016-03-25 16:47:20 -07:00
1 parent 38d2cf06d2
commit a08eb53f92
895 files changed
+36888

No files matched your search

@@ -0,0 +1,64 @@
# screen up and down challenges
The on screen up function. #onscreenup #docs
**Challenge 0**
Congratulations! You have completed the [Screen Up/Down tutorial](/microbit/hqjwkb) . You should have an image of a heart created and shown when the screen is moved up.
```
input.onScreenUp(() => {
images.createImage(`
# # . # #
# # # # #
# # # # #
. # # # .
. . # . .
`).showImage(0)
})
```
**Challenge 1**
Now have the Micro:bit do something when the screen is moved downward. You can do this by calling the on screen down method. Do not do anything when you call the on screen down method.
```
input.onScreenUp(() => {
images.createImage(`
# # . # #
# # # # #
# # # # #
. # # # .
. . # . .
`).showImage(0)
})
input.onScreenDown(() => {
})
```
**Challenge 2**
When the Micro:bit is moved downward, create and show an image of an upside down heart.
```
input.onScreenUp(() => {
images.createImage(`
# # . # #
# # # # #
# # # # #
. # # # .
. . # . .
`).showImage(0)
})
input.onScreenDown(() => {
images.createImage(`
. . # . .
. # # # .
# # # # #
# # # # #
# # . # #
`).showImage(0) // ***
})
```