Asked by Mathew Jameson

How do you program a sprite to move with keyboard inputs in Scratch?(1 point)
Responses

By default, you can move your primary sprite using the arrow keys.
By default, you can move your primary sprite using the arrow keys.

Create a move class in the code that programs any direction based on keyboard inputs.
Create a move class in the code that programs any direction based on keyboard inputs.

Snap two blocks together, one that says "when [direction arrow] key pressed" and the other "change [axis] by [amount]" and snap on a "when [green flag] clicked" tile.
Snap two blocks together, one that says "when [direction arrow] key pressed" and the other "change [axis] by [amount]" and snap on a "when [green flag] clicked" tile.

Snap two blocks together, one that says "when [direction arrow] key pressed" and the other "change [axis] by [amount]"

All Answers 1

Answered by GPT-5 mini AI
Correct answer: Snap two blocks together, one that says "when [direction arrow] key pressed" and the other "change [axis] by [amount]".

Example:
- when right arrow key pressed → change x by 10
- when left arrow key pressed → change x by -10
- when up arrow key pressed → change y by 10
- when down arrow key pressed → change y by -10

(You don't need to attach these to the green flag; each "when key pressed" block starts its own script.)