Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

Transcript

In this Add-On, you'll make the sprite move through several backdrops to demonstrate that the fitness gadget can work in many different environments.

Begin by adding several backdrops.

To do this, click the stage.

Open the backdrops tab and click choose backdrop.

Click the backdrop you want to add.

Repeat this until you have about three new backdrops.

Next, program the android sprite to glide from one backdrop to the next.

Select the android sprite, then open the scripts tab and click on the motion menu.

Drag the android to the right edge of the stage.

When you let go of the mouse, the values in the glide block update to reflect the sprite's current position.

Drag out the glide block.

Move the android sprite back to its starting point.

Then click the glide block to test it out.

Cool, the android glides to that spot.

To create the illusion that the android is traveling through different environments, add code to switch the backdrop and reset the android back to the left side.

Open the looks menu and add a switch backdrop block to the stack.

Change the dropdown menu to next backdrop.

Then, drag the sprite to the left edge of the stage and add a go to block from the motion menu to the stack.

Click this stack to test it out.

Cool, it looks like the android travels to a new place.

Every time the stack is clicked, the android goes somewhere different.

Add a repeat loop around the stack to make this animation happen over and over again without having to click the stack multiple times.

Click it to test it out.

Tinker with the value in the glide block to make the android move faster or slower.

Change the value in the repeat loop to match the number of backdrops you added so that the android visits each location once.

Test your code often when tinkering.

Right now, this animation ends awkwardly with the android off the left edge of the stage.

Add some code to make the android end in a more natural spot.

This example uses two glide blocks to make the android move left then up the stairs of the Greek theater.

What you do is up to you.

Incorporate this animation into your commercial by adding a when I receive block to the the top of the stack.

Use a descriptive message like, change scene.

Then add at least one broadcast and wait block to the when flag clicked stack in the place where the animation will happen.

Finish by adding a say block to the beginning of the change scene animation so the viewer knows what the android's about to do.

This example says it also works in different geographic areas.

Test the commercial by clicking the flag.

(upbeat music)

Alright, here's the game plan.

First, add some more backdrops.

Next, program the android sprite to look like it's moving through different environments using the glide, switch backdrop, go to and repeat blocks.

Complete the end of the animation using more glide blocks.

Add a say block to introduce this segment.

And finally, incorporate this animation into the commercial using a broadcast and wait block and a when I receive block.

Choose an Add-On
Changing Scene
Move the android through different scenes to see how the gadget reacts.
Weatherproof
Add weather effects to show how rugged the gadget is.
Purchase Decision
Ask the buyer to purchase the object.
Fitness Coach
Code the sprite to have a pulse and talk about its heart rate.
arrow_backward Back
Next arrow_forward
Instructions
  1. Choose an Add-On, and click "watch" to learn how to build it.
  2. Once you finish one Add-On, try another one below the video!