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 Random Rebound

Choose an Add-On
play_circle_filled
Bounce Reaction
Program the ball sprite to do or say something when it bounces.
arrow_forward
play_circle_filled
Team Jersey
Design your athlete to reflect your favorite team.
arrow_forward
play_circle_filled
Second Player
Add a second athlete to make a two player game.
arrow_forward
play_circle_filled
Keep Score
Add a score counter to the game.
arrow_forward
play_circle_filled
Play the Computer
Program a sprite to play against the user.
arrow_forward
play_circle_filled
Random Rebound
Make the ball bounce in a random direction.
arrow_forward
  • 1. Introduction to Conditionals
  • 2. Move Athlete Around
  • 3. Make the Ball Sprite Bounce
  • 4. Bounce Off the Athlete
  • 5. Add-Ons
  • 6. Reflection
  • 7. Wrap-up: Net Sports
  • 8. Wrap-up: Share Your Project
  • 9. Wrap-up: Show Your Project
arrow_backward Back Next arrow_forward
Transcript

This add-on will introduce a feature of Scratch and programming called randomness. Random means unpredictable or unexpected. In this add-on, you’ll program the ball to bounce in a random direction. This is a prompted add-on, which means you won’t see all the steps in the video. You’ll have to figure out some of it on your own.

From the “operators” menu, drag the “pick random” block into the scripts area.

The two values in the "pick random" block are the smallest and biggest values that will be picked randomly.

Figure out where in your ball sprite's bouncing code to place this block to make it pick a new, random direction when it bounces. The ball sprite’s bounce should still look normal, so these numbers should be close to the original number to make the bounce look realistic. Tinker around with them to see how they change the ball sprite's behavior. This may be a challenge. Try to figure it out yourself, but if you need help, ask your neighbor or the Host or Guru.

Here's the game plan: Figure out where to place the "pick random" block in the ball sprite's code. Adjust the values in the block to make a cool-looking random bounce.

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!