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 productthat they are selling so that it’s fresh in your mind the next time you go shopping.
To use this same tactic, click on the showcase sprite, drag out a “show” block and connectit to a “go to front” block. This moves this sprite in front of the other sprite.
Drag a “set effect” block to the scripts area. Select “ghost” from the dropdownmenu, 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 graphic effects” in thelooks menu to make the sprite reappear. Click on the block stack again so that thesprite remains invisible. In order to create a slow transition effect that causes the spriteto reappear gradually, drag out a “change effect” block and select “ghost” fromthe dropdown menu. Then, place a “repeat” loop around the “change effect” block.
Click on the block stack to test. Wait nothing happens! That’s because the ghost effectranges from 0 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 2, then click on the blockstack. The showcase sprite starts to appear. Sweet! Clicking on this stack a few more timesallows the showcase sprite to fully appear on the stage. To avoid clicking the blockstack 5 times to make the sprite fully appear, change the value in the “repeat” loopto 50.
Clicking on the “go to front” block stack hides the showcase sprite, and clicking onthe “repeat” block stack makes it reappear. Connect these two blocks stacks to make thesetwo actions happen one after another. Test it out. Sweet!
To make your fitness gadget fade out after a while, duplicate the “repeat” loop,and change the “ghost” effect to positive 2. Now throw a “wait” block between theseblock stacks, and set the value to however long you want the gadget to remain on thescreen. This example uses 5 seconds.
Test it out. Great! The fitness gadget fades in, shows for 5 seconds, then fades out.
To personalize your project, click on the costumes tab, and add the name of the fitnessgadget along with a tagline.
Feel free to change the color of the backdrop so that your fitness gadget really pops atthe end of the commercial! This code stack is a module. Give it a nameby dragging out a “when I receive” block and adding a new message like “ShowcaseProduct.” 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 dropdown menu. Then, placeit when you want the product showcase to appear. In this example, the product will showcaseat the end of the commercial, so this block goes under the other “broadcast” blocks.
Here's the game plan: Use “show” and “go to front” blocksto make the showcase sprite stand out. Use “set effect,” “change effect by,”“repeat” loops and “wait” blocks to create a transition effect.
Add “broadcast and wait” and “when I receive message” blocks, so your code willrun after the introduction.