In this video, you'll learn
how to showcase your fitness gadget
at the end of the commercial.
This is how fitness companies get you to buy their product.
They remind you of the product that they are selling
so it's fresh in your mind next time you go shopping.
To use this same tactic, click on the showcase sprite,
drag out a show block,
and connect it to a go to front block.
This moves the sprite in front of the other sprite.
Drag a set effect block to the scripts area,
select ghost from the drop down menu,
and change the value to 100.
When you click on the block stack,
the sprite disappears.
A ghost value of 100 makes the sprite invisible.
Click on clear graphics effects in the looks menu
to make the sprite reappear.
Click on the block stack again, so that the sprite
In order to create a slow transition effect
that causes the sprite to reappear gradually,
drag out a change effect block, and select ghost
from the drop down menu.
Then, place a a repeat loop around the change effect block.
Click on the block stack to test.
Wait, nothing happened.
That's because the ghost effect ranges from zero to 100,
and the effect has already been set to 100
using the previous block.
Change the value in the change effect block
to negative two.
Then, click on the block stack.
The showcase sprite starts to appear.
Clicking on the stack a few more times
allows the showcase sprite to fully appear on the stage.
To avoid clicking the block stack five times
to make the sprite fully appear,
change the value in the repeat loop to 50.
Clicking on the go to front block stack
hides the showcase sprite, and clicking
on the repeat block stack makes it reappear.
Connect these two block stacks to make these two actions
happen one after another.
Test it out.
To make your fitness gadget fade out after a while,
duplicate the repeat loop,
and change the ghost effect to positive two.
Now throw a wait block between these block stacks,
and set the value to however long you want
the gadget to remain on the screen.
This example uses five seconds.
The fitness gadget fades in, shows for five seconds,
then fades out.
To personalize your project, click on the costumes tab,
and add the name of the fitness gadget
along with a tagline.
Feel free to change the color of the backdrop
so that your fitness gadget really pops
at the end of the commercial.
The code stack is a module.
Give it a name by dragging out a when I receive block,
and adding a new message like showcase product.
Finally, tell your program when to run
the showcase product module.
Click back to the athlete sprite,
and drag out another broadcast and wait block.
Select showcase product from the drop down menu.
Then, place it when you want the product showcase to appear.
In this example, the product will showcase
at the end of the commercial,
so this block goes under the other broadcast blocks.
Alright, here's the game plan.
First, use show and go to front blocks
to make your sprite stand out.
Use the set effect to, change effect by,
repeat loops, and wait blocks to create a transition.
Add broadcast and when I receive message blocks
so your code will run after the introduction.
Sign in to track your progress and earn badges