Do Now 3.4 Practice using Arguments

Last class, you created a “gravity” custom block where a sprite would fall to the ground and stop when it touched a color.

However, the sprite always falls at the same rate. How would we get the sprite to fall at different rates?

We will solve this problem by adding an argument to the custom block named “gravity”. We can then pass the rate we want the sprite to move.

  1. Open Do Now 3.3 with the “gravity” custom block.

  2. Add an argument named “rate” to the “gravity” block by clicking the “+” next to the custom block name.

  3. Change the “move” block to move “rate” spaces by dragging the rate variable to the “move” block.

  4. You can now pass different rates in your “gravity” custom block call located in the sprite’s forever loop.