Skip to content

Please update your browser

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

arrow_back Bounce Everywhere

Transcript

Now you will program a letter to bounce all around the screen.

This kind of animation can show the personality of the name you choose or just be fun.

To start, add a new sprite to your project.

Scroll through the library of available sprites until you find the letter you need.

Click on the sprite to add it to your project.

This example uses the letter A, but you will add a sprite for the name you are animating.

Then code the sprite to move.

On the code tab, select the motion menu.

Click, hold, and drag out a move block.

Click the block to see what it does.

The letter moves 10 steps.

To make the sprite move more, change the value in the move block to 30.

Click the block again to test it.

Not bad, but if the sprite is going to bounce off the edges of the stage, it needs to move more.

Try a value of 100.

Click the block to test.

That's better.

Next, make the sprite move more than once without having to click the block.

Click the control menu and drag out a repeat block.

Place it around the move block.

The repeat block runs the blocks inside it a specific number of times.

To increase how many times the sprite moves, type a larger value in the repeat block.

Click the block stack to see what happens.

The sprite moves, but it moves all the way to the edge of the stage then stops.

To make the sprite bounce, click the motion menu.

Then drag out an if on edge bounce block.

Place it inside the repeat block, under the move block.

Click the block stack to see what happens.

The sprite bounces back and forth between the right and the left edges of the stage.

Next, make the sprite bounce all around the parts of the stage, not just back and forth.

From the motion menu, drag out a point and direction block.

Snap it to the top of your block stack.

Click the block stack to test.

The sprite bounces off the right and the left edges of the stage and flips upside down and right side up.

Next, make the sprite change direction to bounce randomly around the stage instead of just flipping back and forth.

Click the operator's menu, drag out a pick random block, and place it in the variable space on the point and direction block.

Change the values in the pick random block to one to 180.

These values represent the area of the entire stage.

Click the block stack a few times to see what happens.

The sprite bounces around the stage, but every time you click, the sprite stops its bounce in a random area of the stage.

To make the sprite return to its starting position after it bounces, click the motion menu.

And find the go to X Y block in the menu.

Don't drag it out yet.

Click on the sprite and move it to its correct ending position.

The values in the go to X Y block automatically update to match the sprite's position.

Drag out the go to X Y block and snap it to the bottom of your block stack.

Click the block stack to test.

The sprite bounces all around the stage and it ends in its correct position in your project.

To make the sprite finish the animation facing upright, from the motion menu, drag out a point and direction block.

Snap it to the bottom of your block stack.

Click the block stack again.

The sprite bounces all around the screen, returns to the correct position, and ends up facing upright.

What a great animation.

If your animation didn't work as expected, keep trying.

Next, make this animation run when the sprite is clicked.

From the events menu, drag out a when the sprite clicked event.

Attach it to the top of your block stack.

Click the sprite.

The letter bounces all around when you click it.

Now it's your turn.

Add a new sprite to your project.

Add a move block and a repeat block and change the value.

Add in if on edge bounce block, a point and direction block, and go to X Y block.

Add a when this sprite clicked event to the top of the block stack.

Once you finish these steps, return to this page to select another add on to try.

Choose an Add-On
Change Color
Change the color of a letter when it’s clicked.
Grow and Shrink
Change the size of a sprite when it’s clicked and add a sound to match the animation.
Draw a Letter
Draw your own letter and make it move.
Spin
Add a letter and rotate it when it’s clicked.
Bounce
Move the sprite up and down and add a sound as it bounces
Wave
Create and change to different costumes.
Bounce Everywhere
Move the sprite all around the stage, then make it return to a specific point.
New Backdrop
Switch to a different backdrop by clicking the letter or sprite.
Say Something
Make the letters talk to each other when the green flag is clicked.
Sprite Dance
Make a sprite dance when the sprite is clicked.
Add Background Music
When you click a sprite, play a song and change the background
Play a Beat
Play a drum beat when the sprite is clicked.
Next arrow_forward
Instructions
  1. Watch the introduction video.
  2. Open the Starter Project below.
  3. Return to this page and watch more videos to customize your project.
Attributions
  • "NYSD - Pet Name" by techwonder21 (https://scratch.mit.edu/projects/226242085/editor) -- Licensed under CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0/)
  • Animate a Name is based off of the 'Animate Your Name' Scratch tutorial (http://scratch.mit.edu/name) developed by Scratch team at the MIT Media Lab. It was adapted and re-developed by Google in partnership with 4-H (http://4-h.org/), West Virginia University and Utah State University for National Youth Science Day 2018 (https://4-h.org/parents/national-youth-science-day/), 4-H's largest annual STEM challenge.
  • "4H_Emblem" by US Government (https://commons.wikimedia.org/wiki/File:4H_Emblem.svg) -- Licensed by CC0 Public Domain (https://creativecommons.org/share-your-work/public-domain/cc0/)
  • "NYSD - Adjective Name" by techwonder21 (https://scratch.mit.edu/projects/226481973/editor) -- Licensed under CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0/)