pxt-calliope/olddocs/js/lessons/rectangle-explosion/challenges.md
2016-05-26 19:33:26 -07:00

1.5 KiB

snowflake fall challenges

These challenges will allow you to make an exploding rectangle. #docs

Challenge 0

This guided tutorial will help you create a snowflake animation!

basic.forever(() => {
    basic.showAnimation(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`, 400)
})

Challenge 1

Let's begin creating our falling effect by adding another snowflake with show animation that displays a different snowflake pattern after the first one.

basic.forever(() => {
    basic.showAnimation(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`, 400)
    basic.showAnimation(`
. . . . . . . # . .
. . # . . . # . # .
. # # # . # . . . #
. . # . . . # . # .
. . . . . . . # . .
`, 400) // ***
})

Challenge 2

To finalize our snowflake fall, let's add a different snowflake pattern.

basic.forever(() => {
    basic.showAnimation(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`, 400)
    basic.showAnimation(`
. . . . . . . # . .
. . # . . . # . # .
. # # # . # . . . #
. . # . . . # . # .
. . . . . . . # . .
`, 400)
    basic.showAnimation(`
. . . . . . . # . . . # . # .
. . # . . . # . # . # # . # #
. # # # . # . . . # . . . . .
. . # . . . # . # . # # . # #
. . . . . . . # . . . # . # .
`, 400) // ***
})

Challenge 3

If you notice, we have three basic->show animation() functions. Try to create the snowflake fall effect by just using one basic->show animation().