pxt-calliope/docs/reference/js/lessons/snowflake-fall/quiz-answer.md
2016-04-01 16:22:47 -07:00

1.4 KiB

snowflake fall quiz answers

create a snowflake fall animation.

Name

Directions

Use this activity document to guide your work in the snowflake fall tutorial.

Answer the questions while completing the tutorial. Pay attention to the dialogues!

1. In reference to an animation, what is an "interval"?

The number of milliseconds to pause after each image frame.

2. Consider the following code

basic.showAnimation(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`, 400)

What is the interval of the animation?

400

3. Consider the following image

Write the code to create a forever loop that shows an animation. Change the interval from 400 to 200 to make the animation go twice as fast!

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

4. Consider the following images

Write the code to create a forever loop that shows an animation. Change the interval from 400 to 800 to make the animation go twice as slow!

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