Migrate docs from the other repo
This commit is contained in:
63
docs/lessons/snowflake-fall/activity.md
Normal file
63
docs/lessons/snowflake-fall/activity.md
Normal file
@ -0,0 +1,63 @@
|
||||
# snowflake fall blocks activity
|
||||
|
||||
design a blinking rectangle animation. #docs #tutorials #stepByStep
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
### @video td/videos/snowflake-fall-0
|
||||
|
||||
Welcome! This tutorial will teach how design a **snowfall animation**. Let's get started!
|
||||
|
||||
### ~
|
||||
|
||||
Let's start by creating a `forever` loop that will allow us to repeat the show LEDs code. Any code in the `forever` loop will repeat in the background... forever.
|
||||
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
})
|
||||
```
|
||||
|
||||
The next step is to add two `show LEDs` blocks inside the `forever` loop to repeat an animation.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
. # . # .
|
||||
# . . . #
|
||||
. # . # .
|
||||
. . # . .
|
||||
`)
|
||||
})
|
||||
```blocks
|
||||
|
||||
Run your code in the simulator or download it to your BBC micro:bit to see what happens!
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/microbit/lessons/snowflake-fall/challenges)!
|
||||
|
||||
### ~
|
||||
|
Reference in New Issue
Block a user