Working with the slider
We've seen from the previous recipe that the slider can play a valuable role in working with basic programs. The slider can be very useful anytime you need a number in a range, and want that to be sensitive for the user to control.
In this recipe, we're going to dig deeper into using the slider. We are going to make a basic program where our sprite will move up and down as the slider moves.
Getting ready
We'll accomplish this by having a forever loop that is constantly checking the slider value, and applying it.
Open a new Scratch project to get started on this one.
How to do it...
Here are the steps we will need to get this recipe going:
- Drag over a block.
Insert a forever loop directly below this top hat block.
From the Motion category, drag a set y to () block, as shown in the following screenshot:
Head over to the Sensing category and drag a () sensor value block, replacing the value of
0
from the block created in step 3.You should now have the following code, and if...