pxt-calliope/docs/reference/js/lessons/snowflake-fall/activity.md

42 lines
923 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# snowflake fall activity
2016-04-02 01:22:47 +02:00
design a blinking rectangle animation.
2016-03-26 00:47:20 +01:00
### ~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 `basic->forever` loop that will allow us to repeat the animation code. Any code in the `forever` loop will repeat in the background... forever.
```
basic.forever(() => {
}) // ***
```
The next step is to add `basic->show animation` inside the `forever` loop to repeat an animation.
```
basic.forever(() => {
basic.showAnimation(`
. . . . . . . . . .
. . # . . . . . . .
. # # # . . . . . .
. . # . . . . . . .
. . . . . . . . . .
`, 400) // ***
})
```
Run your code in the simulator or download it to your BBC micro:bit to see what happens!
### ~avatar avatar
2016-04-13 17:27:45 +02:00
Excellent, you're ready to continue with the [challenges](/lessons/snowflake-fall/challenges)!
2016-03-26 00:47:20 +01:00
### ~