User Input and Interaction
User input for programs can come in many forms. Most often, a user interacts with a program by clicking or moving a mouse, or through typing via a keyboard. In this way, a user can direct a program to behave in a certain way without predetermining the data when programming. In the following activity, you will program Scratch the Cat to react to user input.
In order to do that, we will use the
when event blocks located in the “Control” tab.
The event trigger can be changed using the drop down menu. Create 4 separate
event blocks corresponding to each of the arrow keys.
Moving with the Arrow Keys
Now that our program is anticipating four different key presses as possible inputs, let’s instruct Scratch to react to these inputs. We can use the block
point in direction [...] located in the Motion tab as shown below:
Your job is to create a program with a sprite that moves related to user input, including arrow keys and at least two other inputs.
Program an original program in Scratch that meets the following minimum requirements for your Scratch program:
- Create a new Scratch program with at least one sprite.
- Create four separate
eventblocks corresponding to each of the arrow keys.
- Add the appropriate
point in direction [...]block to each
eventblock you created above. NOTE: The Cat should react to each key press by facing the proper direction.
- Attach a
move  stepsblock to each of your events. Note: The Cat should move around based upon the arrow keys pressed.
- Add two other
eventblocks that react to different user input (e.g., key presses, mouse movement/clicks)
- Personalize it in at least three other ways.
- Provide documentation for your program (describe what it does) as the Instructions. Be sure to describe how your program is original.
When you are satisfied with your work, submit a link to your program or the program itself.