Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 763 Bytes

do_now_34.md

File metadata and controls

15 lines (8 loc) · 763 Bytes

Practice using arguments

Open your DoNow3.3 program. In this program, you created a gravity block where a sprite would fall to the ground and stop when it touched a color. 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 gravity block. We can then pass the rate we want the sprite to move.

  1. Add an argument named "rate" to the gravity block by clicking the "+" next to the block name.

  2. Change the move block to move "rate" spaces by dragging the rate variable to the move block.

  3. You can now pass different rates in your gravity block call located in the sprite's forever loop.

  4. Save your project as DoNow3.4.