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