Keyboard input to a program
There are many cases where you may want to get your user to input some text or numbers into a program you are creating. For instance, you may want to get your program to get a value to change something from the user. You may also be playing a game and need input from the user to answer a question.
In this recipe, we'll explore how we can use a Sensing block that will accomplish all of this for us.
Getting ready
To prepare, let's create a new program. We'll create a program that creates a bit of user interaction and incorporates some of what we've learned already. Import a sprite of your choice, as well as a background of your choice, before we get going.
Note
We are using Tera (from Fantasy) as our sprite with bedroom2 (from Indoors) as our background. The rest of this section of the recipe is preparing for a couple of the optional things we'll do in this recipe.
How to do it...
The following are the steps for this recipe:
Drag over the when green flag clicked block from...