From the course: Learning Scratch

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Events

Events - Scratch Tutorial

From the course: Learning Scratch

Start my 1-month free trial

Events

- [Voiceover] Events scripts allow you to respond to things that happen, for example, when the green flag is clicked, when a key is pressed, when the sprite was clicked, etc. Using these events, you can add interactivity to your applications. Let's say, for example, that we wanted to move the ladybug here on the screen with the keyboard. Well, we know that we're going to need to respond to the four directional buttons at least. So I'm going to drag out four of these when key pressed events just like this. Now I'm going to need to handle up, down, left, and right. So in the drop-down where it says space in the top left one, I'm going to click that arrow and I'm going to choose the up arrow. And to the right of that I'm going to choose down arrow. And then I'm going to do left and right as well. So left there, and then right there. So we want to respond when the key is pressed. The first step is actually turning the sprite in the right direction. To do that, we'll go over to Motion, and…

Contents