pxt-calliope/olddocs/js/lessons/glowing-image/challenges.md
2016-04-15 14:37:25 -07:00

1.0 KiB

glowing mountain challenges

These challenges will help you display a glowing image that fades in and out at different speeds. #docs

Challenge 0

This guided tutorial will teach you how to create a mountain that fades out.

images.createImage(`
. . . . .
. . # . .
. # # # .
# # # # #
# # # # #
`).showImage(0)
led.fadeOut(700)

Challenge 1

Now, let's add basic->pause(1000) after the fade in so that there will be a 1000 millisecond delay after the fade out.

images.createImage(`
. . . . .
. . # . .
. # # # .
# # # # #
# # # # #
`).showImage(0)
led.fadeOut(700)
basic.pause(1000) // ***

Challenge 2

After the pause, let's add led->fade in(2000) so that we can create a glowing effect.

images.createImage(`
. . . . .
. . # . .
. # # # .
# # # # #
# # # # #
`).showImage(0)
led.fadeOut(700)
basic.pause(1000)
led.fadeIn(2000) // ***

Challenge 3

Now add another basic->pause(1000) and led->fade out(900) so that the mountain can fade out again.