WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 00:00:00.000 --> 00:00:03.451 [MUSIC PLAYING] 00:00:17.033 --> 00:00:19.200 BRIAN YU: Welcome back, everyone, to An Introduction 00:00:19.200 --> 00:00:20.580 to Programming with Scratch. 00:00:20.580 --> 00:00:23.880 And last time we took a look at the fundamentals of programming-- 00:00:23.880 --> 00:00:26.160 putting together a sequence of instructions 00:00:26.160 --> 00:00:30.345 that we called Functions by assembling these different colored Scratch blocks. 00:00:30.345 --> 00:00:32.970 And by putting together these different colored Scratch blocks, 00:00:32.970 --> 00:00:35.220 we were able to bring our projects to life. 00:00:35.220 --> 00:00:38.070 We were able to take characters, or sprites, on the stage, 00:00:38.070 --> 00:00:42.240 and have them move around, or draw pictures, and play sound, and more. 00:00:42.240 --> 00:00:45.060 And so today, let's take those concepts of programming 00:00:45.060 --> 00:00:47.440 and build upon them a little bit more. 00:00:47.440 --> 00:00:50.640 I'll go ahead and open up Scratch again, and let's start with a program 00:00:50.640 --> 00:00:51.820 that we've seen before. 00:00:51.820 --> 00:00:54.900 I'll go ahead and go into the Looks section of the blocks 00:00:54.900 --> 00:00:58.870 and pull out this Say Hello For 2 Seconds block. 00:00:58.870 --> 00:01:01.290 And as you might recall, when I click on this block 00:01:01.290 --> 00:01:04.290 to run this Stack, or script of code, you'll 00:01:04.290 --> 00:01:08.130 see that my cat over on the stage says "hello" for two seconds, 00:01:08.130 --> 00:01:09.510 and then it stops. 00:01:09.510 --> 00:01:11.940 And so that seems to work well, but notice 00:01:11.940 --> 00:01:16.110 that in order to run this program, I had to click on the code 00:01:16.110 --> 00:01:18.720 that I wanted the cat to run. 00:01:18.720 --> 00:01:21.590 And that might be fine, but if you've used programs on your computer 00:01:21.590 --> 00:01:23.760 or on your phone before, then you probably 00:01:23.760 --> 00:01:26.940 haven't specifically told the program which part of the code 00:01:26.940 --> 00:01:28.290 you want it to run when. 00:01:28.290 --> 00:01:31.320 You open up an app and some code runs, or you click a button 00:01:31.320 --> 00:01:34.260 and some code runs, or you type something onto your keyboard 00:01:34.260 --> 00:01:36.270 and some code runs-- you're not specifically 00:01:36.270 --> 00:01:40.950 pointing to what lines of code in a program you generally want to run. 00:01:40.950 --> 00:01:44.070 And one other problem here might be what might 00:01:44.070 --> 00:01:47.460 happen if I have multiple scripts across multiple sprites maybe. 00:01:47.460 --> 00:01:50.160 Imagine that it's not just the cat saying "hello, " 00:01:50.160 --> 00:01:52.080 but the cat talking to-- 00:01:52.080 --> 00:01:55.270 let's pick another sprite, let's pick the dinosaur. 00:01:55.270 --> 00:01:57.630 So I'll go into Animals and choose the dinosaur, 00:01:57.630 --> 00:02:00.850 and maybe I want these two to say hello to each other. 00:02:00.850 --> 00:02:04.110 So I'll move it so that the cat and the dinosaur are next to each other, 00:02:04.110 --> 00:02:07.860 and I want to turn the dinosaur around so that they're facing each other. 00:02:07.860 --> 00:02:11.490 And I can do that recall by going into the direction for the dinosaur 00:02:11.490 --> 00:02:16.050 and having it face the left instead of facing the right. 00:02:16.050 --> 00:02:18.390 And now it seems like the dinosaurs upside down, 00:02:18.390 --> 00:02:22.350 so I just need to remember to change the rotation style to left and right 00:02:22.350 --> 00:02:24.720 instead of all around-- and so now the cat 00:02:24.720 --> 00:02:26.830 and the dinosaur are facing each other. 00:02:26.830 --> 00:02:31.140 And if I want them both to say hello to each other, well then this dinosaur-- 00:02:31.140 --> 00:02:32.970 notice the dinosaur is now selected-- 00:02:32.970 --> 00:02:36.640 is also going to need a block that lets it say hello. 00:02:36.640 --> 00:02:41.430 So I'll also give it a block that says Say Hello For 2 Seconds-- 00:02:41.430 --> 00:02:44.310 but now if I want the cat to say hello to the dinosaur, 00:02:44.310 --> 00:02:47.025 well, then I'll need to go to the cat, click the Say Hello block, 00:02:47.025 --> 00:02:49.650 but then very quickly click on the dinosaur and click Say Hello 00:02:49.650 --> 00:02:52.970 too so that they can both say hello to each other. 00:02:52.970 --> 00:02:56.220 It was a bit tedious for me to have to quickly jump back and forth between two 00:02:56.220 --> 00:02:59.730 sprites, and you could imagine that at a more complex project where 00:02:59.730 --> 00:03:02.760 a sprite might have multiple different scripts that we want to run, 00:03:02.760 --> 00:03:04.440 or you might have many more sprites-- 00:03:04.440 --> 00:03:08.130 it's not going to be possible for me to, in any reasonable amount of time, 00:03:08.130 --> 00:03:12.300 go to all of the different sprites and start up all of the different blocks 00:03:12.300 --> 00:03:13.410 that I want to run. 00:03:13.410 --> 00:03:16.510 It would be better if I could just say, let's start the project, 00:03:16.510 --> 00:03:21.300 and when the project starts then that I want all of these scripts of code 00:03:21.300 --> 00:03:22.830 to run automatically. 00:03:22.830 --> 00:03:25.810 And we can do just that via this button-- 00:03:25.810 --> 00:03:27.790 it's in the upper right of the Scratch window-- 00:03:27.790 --> 00:03:28.770 this is the flag. 00:03:28.770 --> 00:03:30.990 And generally when you click on this green flag, 00:03:30.990 --> 00:03:34.560 that marks the start of your Scratch project. 00:03:34.560 --> 00:03:37.440 Of course right now, when I click on this green flag-- 00:03:37.440 --> 00:03:39.810 nothing's happening, and so here is where 00:03:39.810 --> 00:03:42.240 we're going to introduce a new concept in programming 00:03:42.240 --> 00:03:44.100 and that's the concept of an Event. 00:03:44.100 --> 00:03:47.460 And we can see the Event blocks as one of the options along the left hand 00:03:47.460 --> 00:03:49.470 side of the Scratch window. 00:03:49.470 --> 00:03:53.430 And an Event is just something that happens inside of our program 00:03:53.430 --> 00:03:55.710 that we could have some code respond to. 00:03:55.710 --> 00:03:57.660 We could say that, when something happens-- 00:03:57.660 --> 00:03:59.850 for example, when the flag is clicked-- 00:03:59.850 --> 00:04:02.610 then I want the cat to say hello for two seconds, 00:04:02.610 --> 00:04:07.000 or I want the dinosaur to say hello for two seconds as well. 00:04:07.000 --> 00:04:11.670 And so, we do have this very first Event block here, When Flag Clicked, 00:04:11.670 --> 00:04:15.000 and I'm going to take this block and drag it on top 00:04:15.000 --> 00:04:18.510 of the Say Hello For 2 Seconds block. 00:04:18.510 --> 00:04:22.950 And so now I've attached my code to a particular Event-- 00:04:22.950 --> 00:04:25.320 this block here is called When Flag Clicked. 00:04:25.320 --> 00:04:28.410 It means that when this Event happens, when the flag is clicked, 00:04:28.410 --> 00:04:31.800 we are going to run all of the code that is attached beneath it. 00:04:31.800 --> 00:04:34.740 And notice that nothing can be attached on top of this event 00:04:34.740 --> 00:04:38.970 block-- this event is the beginning of the script of these blocks of code 00:04:38.970 --> 00:04:40.110 that I want to now run. 00:04:40.110 --> 00:04:42.600 And so now, when I click on the green flag, 00:04:42.600 --> 00:04:46.530 the dinosaur is going to respond by saying hello for two seconds. 00:04:46.530 --> 00:04:49.920 So I go back to the project here, click on the green flag, 00:04:49.920 --> 00:04:54.510 and the dinosaur says "hello. " And now if I want the cat to say hello too, 00:04:54.510 --> 00:04:57.750 well, then all I need to do is click on the cat in the sprite chooser down 00:04:57.750 --> 00:05:01.690 below, and add the When Flag Clicked Event to it as well. 00:05:01.690 --> 00:05:06.240 So I'll take the When Flag Clicked block, drag it on top of the Say block, 00:05:06.240 --> 00:05:07.042 and now-- 00:05:07.042 --> 00:05:08.250 when I click the green flag-- 00:05:08.250 --> 00:05:11.910 I just have to click once and both the cat and the dinosaur 00:05:11.910 --> 00:05:15.690 are going to say hello rather than me having to click one block immediately 00:05:15.690 --> 00:05:20.140 very quickly, jump to another sprite, and then click on the block as well. 00:05:20.140 --> 00:05:22.050 And the nice thing now is that someone can 00:05:22.050 --> 00:05:25.668 run my project without ever looking at my code and the code will still work. 00:05:25.668 --> 00:05:27.960 They don't have to know which blocks to click on-- they 00:05:27.960 --> 00:05:30.600 can just click on the green flag and see the project work. 00:05:30.600 --> 00:05:32.433 And in fact, that's what happens if you were 00:05:32.433 --> 00:05:35.100 to share your Scratch project on Scratch's website-- sending it 00:05:35.100 --> 00:05:37.170 to friends or family for example. 00:05:37.170 --> 00:05:40.470 They'll usually just see your project without seeing the code at first, 00:05:40.470 --> 00:05:43.680 and they can run your project, and see that both the cat-- 00:05:43.680 --> 00:05:47.100 and the dinosaur, in this case, are going to say hello. 00:05:47.100 --> 00:05:50.550 So these are Events, where when something happens in the project, 00:05:50.550 --> 00:05:54.540 we can respond to that happening by having some blocks of code run. 00:05:54.540 --> 00:05:57.368 But there are other Events that we can use as well-- 00:05:57.368 --> 00:05:59.160 and let's take a look at another Event now. 00:05:59.160 --> 00:06:03.330 I'll delete the cat and the dinosaur for now, and let's add a new sprite-- 00:06:03.330 --> 00:06:07.240 let's pick an animal, and let's go back to the duck here. 00:06:07.240 --> 00:06:11.040 So we have the duck and the Event that we'll take a look at now 00:06:11.040 --> 00:06:14.820 is this one here-- it's called When This Sprite Clicked. 00:06:14.820 --> 00:06:17.670 Meaning, when this sprite is clicked on, some code 00:06:17.670 --> 00:06:20.670 is going to run in response to the fact that I've 00:06:20.670 --> 00:06:22.683 clicked on the duck in this case. 00:06:22.683 --> 00:06:24.600 And I can have anything happen, and maybe what 00:06:24.600 --> 00:06:27.540 I'll have happened just for now is I'll go into Motion, 00:06:27.540 --> 00:06:31.500 and I'll have the duck go to a random position. 00:06:31.500 --> 00:06:36.010 So every time I click on the duck, it's going to go now to a random position. 00:06:36.010 --> 00:06:39.687 So go into the stage, I'll click on the duck, and the duck moves. 00:06:39.687 --> 00:06:42.270 I'll click the duck again and it moves, I click the duck again 00:06:42.270 --> 00:06:45.270 and it moves-- and If I wanted it to move a little bit more smoothly, 00:06:45.270 --> 00:06:49.050 remember that Go To will immediately jump to a random position. 00:06:49.050 --> 00:06:53.940 But I could instead, by removing this block and replacing it with this one, 00:06:53.940 --> 00:06:57.480 have the duck glide to a random position-- take one second 00:06:57.480 --> 00:07:00.030 and just glide smoothly to a different position. 00:07:00.030 --> 00:07:02.190 Now every time I click on the duck, you'll 00:07:02.190 --> 00:07:08.160 notice the duck glide across the stage to a different random position 00:07:08.160 --> 00:07:09.300 on that stage. 00:07:09.300 --> 00:07:13.110 And it's responding, again, not to when I'm clicking on the code itself, 00:07:13.110 --> 00:07:15.690 but when I'm clicking on the duck, and the duck 00:07:15.690 --> 00:07:17.430 is responding because it's an Event. 00:07:17.430 --> 00:07:20.610 The Event is when the sprite is clicked on, we're going to glide. 00:07:20.610 --> 00:07:25.290 And what you'll notice too is that, on the left side of the Scratch window, 00:07:25.290 --> 00:07:26.790 when the sprite is clicked-- 00:07:26.790 --> 00:07:30.600 you'll see this script light up to tell us and indicate to us 00:07:30.600 --> 00:07:32.580 that this script is currently running. 00:07:32.580 --> 00:07:36.120 Right now it's not running, but notice that as soon as I click on the duck 00:07:36.120 --> 00:07:40.770 it lights up for one second as the duck is moving, and then it stops being lit. 00:07:40.770 --> 00:07:44.490 And while it's lit, that's when we know that this particular script happens 00:07:44.490 --> 00:07:45.850 to be running. 00:07:45.850 --> 00:07:49.740 And so the ability to have sprites respond when we click on something-- 00:07:49.740 --> 00:07:51.750 on the stage, when we click on that sprite-- 00:07:51.750 --> 00:07:55.500 on the stage gives us a lot of flexibility and creative potential 00:07:55.500 --> 00:07:58.110 for creating new types of user interfaces-- 00:07:58.110 --> 00:08:01.790 for letting the user interact with our project in different ways. 00:08:01.790 --> 00:08:04.260 In fact, you might think of this as something like a button 00:08:04.260 --> 00:08:06.593 where, when you click on a button on a computer program, 00:08:06.593 --> 00:08:10.180 something happens in response to clicking on that button. 00:08:10.180 --> 00:08:12.330 And now that we have this Event, When Clicked, 00:08:12.330 --> 00:08:16.860 we can create buttons of our own inside of our Scratch projects. 00:08:16.860 --> 00:08:18.210 And so let's try just that-- 00:08:18.210 --> 00:08:20.730 I'll get rid of the duck for now, and let's add 00:08:20.730 --> 00:08:23.550 some backdrops that we might want for our project. 00:08:23.550 --> 00:08:26.430 I'll add a new backdrop and-- 00:08:26.430 --> 00:08:29.578 I like the Arctic backdrop, so we'll pick that one first-- 00:08:29.578 --> 00:08:32.370 and let's choose a couple that I might like to use in this project. 00:08:32.370 --> 00:08:36.360 So I'll choose another one, and let's go now to the jungle-- 00:08:36.360 --> 00:08:39.090 that one seems interesting, slightly different. 00:08:39.090 --> 00:08:43.289 And we'll do one more, and we'll go back to the underwater one 00:08:43.289 --> 00:08:45.960 that we were using with the fish before. 00:08:45.960 --> 00:08:49.410 And so I've got three different backdrops that are part of my project-- 00:08:49.410 --> 00:08:51.960 I've got the Arctic backdrop, I've got the jungle backdrop, 00:08:51.960 --> 00:08:53.940 and I've got the underwater backdrop here. 00:08:53.940 --> 00:08:57.090 Of course, only one backdrop can be active at one time-- 00:08:57.090 --> 00:08:58.470 we can switch between them-- 00:08:58.470 --> 00:09:01.150 but only one can be there at any given time. 00:09:01.150 --> 00:09:04.830 So let's add some buttons to let the user control which 00:09:04.830 --> 00:09:07.650 backdrop is going to be selected. 00:09:07.650 --> 00:09:10.370 I will add a sprite, and notice that there 00:09:10.370 --> 00:09:13.380 are a couple of different types of buttons that I can choose from-- 00:09:13.380 --> 00:09:16.360 I'll go ahead and choose this button, Button2. 00:09:16.360 --> 00:09:22.070 And I'll drag the button down to maybe the left side of the screen-- 00:09:22.070 --> 00:09:23.720 and let's first modify the button-- 00:09:23.720 --> 00:09:27.630 I'll go to the Costumes and I'll add some text to the button. 00:09:27.630 --> 00:09:32.220 I'll add some text and the text will say Arctic, for example-- 00:09:32.220 --> 00:09:37.510 I'll select the text, change its color, and I'll make sure 00:09:37.510 --> 00:09:40.060 that this is by clicking on the arrow. 00:09:40.060 --> 00:09:43.620 Make the text a little bit bigger and center 00:09:43.620 --> 00:09:46.750 the text approximately on the button-- 00:09:46.750 --> 00:09:50.620 and so now I have one button that says Arctic on my project. 00:09:50.620 --> 00:09:53.440 But of course, when I click on the Arctic button, 00:09:53.440 --> 00:09:55.580 nothing's happening just yet. 00:09:55.580 --> 00:09:58.652 So let's add an Event such that, when I click on this button, 00:09:58.652 --> 00:09:59.860 something is going to happen. 00:09:59.860 --> 00:10:04.300 I'll go back into Events, the Event I want is When This Sprite Clicked. 00:10:04.300 --> 00:10:07.240 And when this sprite is clicked, what do I want to happen? 00:10:07.240 --> 00:10:10.660 Well, I want the backdrop to change to the Arctic backdrop. 00:10:10.660 --> 00:10:13.710 The backdrop changing, that has to do with the look of the project, 00:10:13.710 --> 00:10:16.060 so we'll go to the Look section of blocks 00:10:16.060 --> 00:10:22.300 and let's switch backdrop to Arctic. 00:10:22.300 --> 00:10:26.350 And now when I click on the button, you'll notice the backdrop change. 00:10:26.350 --> 00:10:28.840 I clicked on the button and, because we have that Event, 00:10:28.840 --> 00:10:31.550 it's responding to us as well. 00:10:31.550 --> 00:10:34.880 And so now let's add buttons for each of the other backdrops 00:10:34.880 --> 00:10:36.880 that I might want to switch to in this project-- 00:10:36.880 --> 00:10:39.255 and I could do that by doing exactly what I've just done, 00:10:39.255 --> 00:10:42.250 by adding a new sprite, choosing the button again, adding some text. 00:10:42.250 --> 00:10:44.710 But it'll be a little bit easier actually for now 00:10:44.710 --> 00:10:49.520 to just duplicate the sprite that I already have-- this button here. 00:10:49.520 --> 00:10:53.110 So I'll go ahead and Right-click or Control-click on the sprite and click 00:10:53.110 --> 00:10:54.160 Duplicate-- 00:10:54.160 --> 00:10:58.180 I've got another button, these are just called Button2 and Button3 for now. 00:10:58.180 --> 00:11:00.290 It'll be a little bit nicer if I give them names-- 00:11:00.290 --> 00:11:07.820 I'll call this button Arctic Button, and I'll call this button Jungle Button. 00:11:07.820 --> 00:11:09.090 What do I need to do? 00:11:09.090 --> 00:11:12.510 Well, let's go into Costumes and first change this text. 00:11:12.510 --> 00:11:18.990 Let's change the text to Jungle, recenter the text a little bit there, 00:11:18.990 --> 00:11:23.080 and now when this sprite is clicked-- when the jungle button is clicked-- 00:11:23.080 --> 00:11:27.330 I can switch the backdrop to the jungle instead. 00:11:27.330 --> 00:11:30.090 And notice that in the upper right portion of the Code Editor, 00:11:30.090 --> 00:11:34.020 you'll always see a slightly transparent image of what sprite you're currently 00:11:34.020 --> 00:11:37.500 working on-- in case you ever forget, it's also selected down below-- 00:11:37.500 --> 00:11:41.400 but right now I can tell because I see this slightly faded Jungle Button 00:11:41.400 --> 00:11:45.370 that right now I'm editing the code for this Jungle Button. 00:11:45.370 --> 00:11:49.050 And now when I click on the button, the backdrop changes to the jungle-- 00:11:49.050 --> 00:11:54.450 and I can drag this so that it's underneath the Arctic Button. 00:11:54.450 --> 00:11:58.980 And let's add one more button by Control-click and duplicate this 00:11:58.980 --> 00:11:59.650 button-- 00:11:59.650 --> 00:12:03.810 I'll change the name of the button to Underwater Button, 00:12:03.810 --> 00:12:07.290 and now we'll go into costumes-- and change the text, 00:12:07.290 --> 00:12:08.815 change this to Underwater. 00:12:08.815 --> 00:12:11.940 The text is a little too long, so I'll need to make it a bit smaller to fit 00:12:11.940 --> 00:12:13.290 on the button-- that's OK-- 00:12:13.290 --> 00:12:15.750 I can just click on the arrow and that will 00:12:15.750 --> 00:12:21.820 let me drag and resize various different elements on my costume. 00:12:21.820 --> 00:12:24.130 So now I've got a button that says Underwater, 00:12:24.130 --> 00:12:27.430 and I'll switch back to the Code tab now instead of the Costumes tab. 00:12:27.430 --> 00:12:29.470 And now, when this sprite is clicked, let's 00:12:29.470 --> 00:12:34.480 switch the backdrop to Underwater 1, which was the name of that backdrop. 00:12:34.480 --> 00:12:38.930 And now when I click Underwater, we switch to the underwater backdrop. 00:12:38.930 --> 00:12:41.130 I'll stack these buttons on top of each other-- 00:12:41.130 --> 00:12:44.330 and now what I have are three buttons that the user can click on 00:12:44.330 --> 00:12:46.610 to switch between the various different backdrops. 00:12:46.610 --> 00:12:49.780 Depending on which button they click, they'll 00:12:49.780 --> 00:12:53.830 be able to see the backdrop respond to the buttons 00:12:53.830 --> 00:12:57.070 that they're clicking on as well. 00:12:57.070 --> 00:12:59.010 And so using this we really have the ability 00:12:59.010 --> 00:13:02.280 to let the user interact with the stage-- click on the stage 00:13:02.280 --> 00:13:04.107 and see something actually happen. 00:13:04.107 --> 00:13:05.940 And I'll show you one more example of this-- 00:13:05.940 --> 00:13:09.210 I'll get rid of our buttons for now, and I'll go back to backdrops, 00:13:09.210 --> 00:13:12.720 and go ahead and switch us back to the plain white backdrop. 00:13:12.720 --> 00:13:16.290 But let's add some sprites that the user might interact with, 00:13:16.290 --> 00:13:17.740 I'll go ahead and add sprites. 00:13:17.740 --> 00:13:19.650 And so far I've mostly been using animals, 00:13:19.650 --> 00:13:24.810 but let's jump to the Music tab for now and add a few instruments. 00:13:24.810 --> 00:13:28.300 Let's add a snare drum, and let's add one more-- 00:13:28.300 --> 00:13:34.210 let's add the conga drums, and let's add one more-- 00:13:34.210 --> 00:13:38.040 let's add the cymbal. 00:13:38.040 --> 00:13:40.000 So we'll go ahead and move these around-- 00:13:40.000 --> 00:13:42.720 I've got three different drums. 00:13:42.720 --> 00:13:46.260 And now, when I click on each of them-- let me go to Events 00:13:46.260 --> 00:13:50.880 and drag out this When This Sprite Clicked button. 00:13:50.880 --> 00:13:55.050 We'll go into Sound and we can play a sound, 00:13:55.050 --> 00:13:57.360 and I'll play-- we have a bunch of different snare 00:13:57.360 --> 00:14:00.580 drum sounds I can choose from-- which is like the tap snare, for example. 00:14:00.580 --> 00:14:04.440 And let's add a sound to each of these various different drums 00:14:04.440 --> 00:14:07.470 for when I click on that sprite-- so for the conga drums, 00:14:07.470 --> 00:14:12.540 I'll go back to Events, When This Sprite Clicked, I go back to Sounds 00:14:12.540 --> 00:14:14.340 and say let's play a sound. 00:14:14.340 --> 00:14:17.700 Let's play the-- let's go with the high conga sound-- 00:14:17.700 --> 00:14:22.800 and finally we go into the cymbal, and say-- now when the cymbal is clicked, 00:14:22.800 --> 00:14:28.230 let's go ahead and play the sound crash cymbal. 00:14:28.230 --> 00:14:32.340 And just with that, with two blocks of code for each of my three drums-- 00:14:32.340 --> 00:14:35.200 one Event and one block that plays a sound-- 00:14:35.200 --> 00:14:38.250 now I have a drum kit that I've built just using Scratch. 00:14:38.250 --> 00:14:48.707 When I click on any one of these drums, you hear some sounds, 00:14:48.707 --> 00:14:51.040 and you can have fun with that adding other instruments, 00:14:51.040 --> 00:14:54.130 playing music-- remember we have that music extension that we took 00:14:54.130 --> 00:14:57.430 a look at last time that gives you various different options for playing 00:14:57.430 --> 00:15:00.130 notes and playing other instrumental sounds. 00:15:00.130 --> 00:15:04.480 And so you could create some music, and let the user create some music just 00:15:04.480 --> 00:15:08.150 by clicking on things inside of their Scratch project. 00:15:08.150 --> 00:15:12.080 And so that then is the power of responding to a Click Event-- 00:15:12.080 --> 00:15:15.290 clicking is an Event, the user clicking somewhere on the stage. 00:15:15.290 --> 00:15:18.260 And just by adding this one block, When This Sprite Clicked, 00:15:18.260 --> 00:15:21.650 we were able to add functionality-- some behavior that happens, 00:15:21.650 --> 00:15:26.030 some functions that run when we click on a particular sprite. 00:15:26.030 --> 00:15:29.150 But clicking isn't the only way that users can interact with a project, 00:15:29.150 --> 00:15:31.790 they might also, for example, type something 00:15:31.790 --> 00:15:35.552 onto the keyboard-- press a key, for example, and that too is an Event. 00:15:35.552 --> 00:15:37.760 We've seen a couple of different types of Events now, 00:15:37.760 --> 00:15:41.060 but pressing a key on the keyboard is absolutely an Event too 00:15:41.060 --> 00:15:44.640 that we might want our Scratch projects to be able to respond to. 00:15:44.640 --> 00:15:45.960 So let's give that a try-- 00:15:45.960 --> 00:15:52.640 I'll get rid of our drums for now, and let's add a fish. 00:15:52.640 --> 00:16:00.200 We'll go back to the fish and we'll bring the fish into our project, 00:16:00.200 --> 00:16:03.768 and I would like for the fish to do something when I press a key. 00:16:03.768 --> 00:16:06.560 So let's start simple-- let's first figure out what Event do I need 00:16:06.560 --> 00:16:07.670 to use-- 00:16:07.670 --> 00:16:12.020 and well we have this block here that is When Space Key Pressed. 00:16:12.020 --> 00:16:15.440 Which I guess would mean that, when I press the space bar on my keyboard, 00:16:15.440 --> 00:16:17.210 something's going to happen. 00:16:17.210 --> 00:16:18.540 What do I want to have happen? 00:16:18.540 --> 00:16:25.440 Well, let's go into sound, and let's Play the Sound Bubbles Until Done. 00:16:25.440 --> 00:16:28.535 And so now, I'll go ahead and press the Space key-- 00:16:33.090 --> 00:16:36.090 and when I press Space key, you hear the bubbles-- and every time 00:16:36.090 --> 00:16:38.100 I press this Space key, that's a different Event 00:16:38.100 --> 00:16:41.310 and that's going to trigger the running of that code. 00:16:44.930 --> 00:16:48.490 But notice too that this block is actually customizable-- 00:16:48.490 --> 00:16:51.010 I can change it, parameterize it slightly, 00:16:51.010 --> 00:16:52.960 just by clicking on this arrow. 00:16:52.960 --> 00:16:55.420 And this opens up a menu where I can choose 00:16:55.420 --> 00:16:58.090 what key it's going to respond to-- it doesn't just 00:16:58.090 --> 00:17:01.130 have to be when the Space bar on my keyboard is pressed. 00:17:01.130 --> 00:17:05.410 I can have it respond to, let's say, the Right arrow or the Left arrow. 00:17:05.410 --> 00:17:08.150 So I go to Right arrow, and instead of playing 00:17:08.150 --> 00:17:10.710 a sound, when you get the right arrow-- 00:17:10.710 --> 00:17:14.990 let's go ahead and change the x value by 10. 00:17:14.990 --> 00:17:18.020 Remember that each sprite exists in this xy 00:17:18.020 --> 00:17:21.710 coordinate grid on the stage, where x refers to how far to the left 00:17:21.710 --> 00:17:25.099 or to the right a particular sprite is-- and y refers to how 00:17:25.099 --> 00:17:27.770 far up or down a particular sprite is. 00:17:27.770 --> 00:17:32.540 And so now, the Right arrow key is going to move the fish to the right 00:17:32.540 --> 00:17:33.660 by 10 spaces. 00:17:33.660 --> 00:17:35.670 So I'll press the Right arrow key and you'll 00:17:35.670 --> 00:17:37.670 see the fish move a little bit-- press it again, 00:17:37.670 --> 00:17:43.530 and it moves, and it keeps moving every time I press that key. 00:17:43.530 --> 00:17:47.007 Let's now add the ability for this Right to respond to the Left arrow key. 00:17:47.007 --> 00:17:48.840 And this is going to be very similar, I just 00:17:48.840 --> 00:17:50.520 want to move in the opposite direction-- 00:17:50.520 --> 00:17:52.800 I want to go left instead of going right. 00:17:52.800 --> 00:17:56.910 And I could drag the event out and then drag another change x by and change it 00:17:56.910 --> 00:17:59.117 to negative 10 instead of 10 this time. 00:17:59.117 --> 00:18:01.950 But in this case, because it's very similar to the code I've already 00:18:01.950 --> 00:18:06.330 written, I can actually Control-click or Right-click on this script 00:18:06.330 --> 00:18:08.580 and just say Duplicate. 00:18:08.580 --> 00:18:13.660 And when I Duplicate, I get a copy of what it is that I've just written 00:18:13.660 --> 00:18:14.730 and now I can modify it. 00:18:14.730 --> 00:18:17.320 Instead of responding to the Right arrow, 00:18:17.320 --> 00:18:20.010 let's have this script respond to the Left arrow. 00:18:20.010 --> 00:18:24.300 And instead of changing x by 10, let's change x by negative 10 00:18:24.300 --> 00:18:27.660 to have the fish move in the negative direction instead. 00:18:27.660 --> 00:18:30.870 And just for fun, let's go ahead and click on the stage 00:18:30.870 --> 00:18:34.590 and change the backdrop to underwater so that it actually feels like the fish is 00:18:34.590 --> 00:18:37.682 swimming around underwater. 00:18:37.682 --> 00:18:39.640 And so now when I press the Right arrow, you'll 00:18:39.640 --> 00:18:43.600 see the fish moving to the right, and when I press the Left arrow, 00:18:43.600 --> 00:18:46.240 the fish is moving backwards? 00:18:46.240 --> 00:18:49.750 That may not be exactly what I want, but it is moving to the left at least. 00:18:49.750 --> 00:18:51.580 And I can make this a little better maybe 00:18:51.580 --> 00:18:53.697 by allowing its rotation to change-- 00:18:53.697 --> 00:18:55.780 let it face the left when it's moving to the left, 00:18:55.780 --> 00:18:58.300 let it face the right when it's moving to the right. 00:18:58.300 --> 00:19:02.540 And remember I can do that just by using this Point In Direction block. 00:19:02.540 --> 00:19:05.020 So when the Right arrow is pressed, let's go ahead 00:19:05.020 --> 00:19:08.740 and Point In Direction 90 degrees, meaning facing the right, 00:19:08.740 --> 00:19:10.490 and move 10 steps. 00:19:10.490 --> 00:19:14.923 And if the Left arrow key is pressed, let's Point In Direction negative 90. 00:19:14.923 --> 00:19:16.840 And if you didn't remember what number it was, 00:19:16.840 --> 00:19:20.330 you could use this dial of course to change the value as well 00:19:20.330 --> 00:19:22.720 and then change x by negative 10. 00:19:22.720 --> 00:19:25.000 And this might be closer, let's try it out-- 00:19:25.000 --> 00:19:28.360 I press Right and the fish moves to the right. 00:19:28.360 --> 00:19:32.580 Now I press the Left arrow key and the fish turns upside down-- 00:19:32.580 --> 00:19:34.090 OK, not quite what I wanted. 00:19:34.090 --> 00:19:36.820 Again, by default-- when you rotate a sprite, 00:19:36.820 --> 00:19:38.540 it's just going to rotate in a circle-- 00:19:38.540 --> 00:19:40.300 which means it might end up upside down. 00:19:40.300 --> 00:19:43.480 If you just want it to be able to go back and forth between left and right, 00:19:43.480 --> 00:19:48.190 be sure to go to Direction and change the fish's rotation style 00:19:48.190 --> 00:19:49.750 to left and right. 00:19:49.750 --> 00:19:53.950 And now, when it goes right, it faces the right, and when it goes left, 00:19:53.950 --> 00:19:56.120 it faces the left. 00:19:56.120 --> 00:19:58.640 Notice too that, if you wanted to change this with code, 00:19:58.640 --> 00:20:00.080 you also have this block here-- 00:20:00.080 --> 00:20:03.380 Set Rotation Style-- that will let you using a block of code 00:20:03.380 --> 00:20:08.370 decide what rotation style that particular sprite should have. 00:20:08.370 --> 00:20:12.843 And so now I have the ability to let this fish move left and right-- 00:20:12.843 --> 00:20:14.010 and I could add to this too. 00:20:14.010 --> 00:20:18.030 If I want to let it move up and down, then I'll add one more Event, and say-- 00:20:18.030 --> 00:20:21.570 not when the Space key is pressed, but when the Up arrow is pressed. 00:20:21.570 --> 00:20:23.520 Let's go ahead and have it move-- 00:20:23.520 --> 00:20:25.470 we're not changing x anymore, we're instead 00:20:25.470 --> 00:20:31.020 changing y because y refers to the up and down direction of the sprite. 00:20:31.020 --> 00:20:35.010 So when the Up arrow key is pressed, we're going to change y by 10, 00:20:35.010 --> 00:20:37.620 and I'll duplicate this by going to the Event block 00:20:37.620 --> 00:20:41.740 Control- or Right-clicking, clicking Duplicate. 00:20:41.740 --> 00:20:48.310 And now, when the Down arrow is pressed, let's change y by negative 10. 00:20:48.310 --> 00:20:51.060 And so now I can get my fish to move to the right, 00:20:51.060 --> 00:20:56.050 I can get my fish to move to the left, I can get it to move up or down as well. 00:20:56.050 --> 00:20:58.560 And I can get it to move across the stage all just 00:20:58.560 --> 00:21:00.930 by pressing keys on the keyboard. 00:21:00.930 --> 00:21:02.682 And using that ability, you could imagine 00:21:02.682 --> 00:21:04.140 trying to create some sort of game. 00:21:04.140 --> 00:21:06.600 Maybe you've played a game on a computer before where 00:21:06.600 --> 00:21:08.790 you use the arrow keys or other keys on the keyboard 00:21:08.790 --> 00:21:10.590 to move some character around. 00:21:10.590 --> 00:21:14.190 Now we have that exact same ability within Scratch itself too. 00:21:14.190 --> 00:21:17.350 By clicking and by pressing various different keys on the keyboard, 00:21:17.350 --> 00:21:21.250 we can get our sprite to respond to that as well. 00:21:21.250 --> 00:21:23.400 And it's not just the Space and the arrow keys-- 00:21:23.400 --> 00:21:25.980 it's letters of the alphabet that you could have be pressed, 00:21:25.980 --> 00:21:29.250 or numbers on the keypad for example that might be pressed. 00:21:29.250 --> 00:21:31.460 And so let's give that a try too just for fun-- 00:21:31.460 --> 00:21:33.270 I'll add a few more blocks here. 00:21:33.270 --> 00:21:35.730 Let's let the fish change in size-- 00:21:35.730 --> 00:21:39.330 maybe I want to be able to choose between how big or small the fish is 00:21:39.330 --> 00:21:40.600 going to be. 00:21:40.600 --> 00:21:44.610 And so when the 1 key is pressed-- 00:21:44.610 --> 00:21:46.200 let's make it small when you press 1. 00:21:46.200 --> 00:21:53.150 So we'll go into Looks and let's set the size to maybe 50%. 00:21:53.150 --> 00:21:55.940 And I'll duplicate this block again by clicking, 00:21:55.940 --> 00:22:00.220 or Right-clicking or Control-clicking on the Event block, clicking Duplicate. 00:22:00.220 --> 00:22:04.870 Now when the 2 key is pressed, let's make it normal size 100, 00:22:04.870 --> 00:22:06.670 and we'll duplicate one more time. 00:22:06.670 --> 00:22:09.310 Now, when the 3 key is pressed-- 00:22:09.310 --> 00:22:13.220 let's add the size to be bigger, we'll set it to be 200%. 00:22:13.220 --> 00:22:15.230 And so now, watch what happens-- 00:22:15.230 --> 00:22:21.370 I can still move the fish around, it's still responding to the arrow keys, 00:22:21.370 --> 00:22:23.578 but now I can also use the numbers to control how 00:22:23.578 --> 00:22:25.120 big or small the fish is going to be. 00:22:25.120 --> 00:22:29.680 If I press 1, the fish shrinks-- it's now 50% of the usual size. 00:22:29.680 --> 00:22:32.680 When I press 2, it goes back to normal size-- 00:22:32.680 --> 00:22:36.100 and when I press 3, the fish gets much larger-- 00:22:36.100 --> 00:22:39.790 it goes to 200% of its original size. 00:22:39.790 --> 00:22:43.210 And so by putting together these various different scripts, each of which 00:22:43.210 --> 00:22:45.980 is responding to a different key on the keyboard, 00:22:45.980 --> 00:22:49.630 you can allow the user to control your sprites in any number of ways. 00:22:49.630 --> 00:22:53.290 Allowing them to interact with the stage by telling them what to click on, 00:22:53.290 --> 00:22:57.340 what to press, in order to see a particular response appear on the stage 00:22:57.340 --> 00:22:58.913 as well. 00:22:58.913 --> 00:23:01.330 And so now we have the ability within our Scratch programs 00:23:01.330 --> 00:23:04.570 to respond to a number of Events that can respond to the flag Being Clicked, 00:23:04.570 --> 00:23:09.460 to a click of something on the stage, also responding to a press of a key. 00:23:09.460 --> 00:23:12.040 But there are a couple of other fun Events 00:23:12.040 --> 00:23:15.520 that we might let our sprites respond to, so let's try one of them now. 00:23:15.520 --> 00:23:18.860 I'll go ahead and get rid of the fish, and let's 00:23:18.860 --> 00:23:23.060 change the backdrop-- we'll go back to the plain white backdrop, 00:23:23.060 --> 00:23:25.178 and let's add a new sprite. 00:23:25.178 --> 00:23:28.220 And the sprite I want to add this time is the balloon-- we haven't really 00:23:28.220 --> 00:23:29.380 played around with that. 00:23:29.380 --> 00:23:33.300 I'll go ahead and center the balloon and I'll go into Events, 00:23:33.300 --> 00:23:36.720 and the Event I'm curious about now is this one here-- 00:23:36.720 --> 00:23:39.870 When Loudness Is Greater Than 10-- 00:23:39.870 --> 00:23:43.920 and loudness refers to input coming in from your computer's microphone. 00:23:43.920 --> 00:23:45.930 So when you use this block for the first time, 00:23:45.930 --> 00:23:47.820 your browser might ask you for permission 00:23:47.820 --> 00:23:49.778 to use your microphone because Scratch is going 00:23:49.778 --> 00:23:51.760 to be listening to that microphone. 00:23:51.760 --> 00:23:54.990 And what it's going to be doing is calculating how loudly 00:23:54.990 --> 00:23:56.580 it hears something, for example-- 00:23:56.580 --> 00:23:59.010 it's all going to be on a 0 to 100 scale where 00:23:59.010 --> 00:24:03.240 0 is like complete silence and 100 is very, very loud. 00:24:03.240 --> 00:24:09.000 And so if I set this to maybe 30 or so, then this code is going to respond, 00:24:09.000 --> 00:24:14.410 and it's going to run some code whenever the loudness gets above 30 for example. 00:24:14.410 --> 00:24:18.480 And what I'm going to do is, when the loudness gets above 30, 00:24:18.480 --> 00:24:22.380 let's go to Looks and change the size by 10. 00:24:22.380 --> 00:24:25.077 We're going to increase the size of the balloon by 10-- 00:24:25.077 --> 00:24:28.410 and I haven't connected them yet because I don't want this code to start running 00:24:28.410 --> 00:24:32.640 just yet-- but once I connect it, what's going to happen is that whenever 00:24:32.640 --> 00:24:35.235 Scratch detects that the loudness has gone above 30-- 00:24:35.235 --> 00:24:37.860 and I might have to play around with that number a little bit-- 00:24:37.860 --> 00:24:40.653 then the size of the balloon is going to change by 10. 00:24:40.653 --> 00:24:42.570 And so this lets me have a little bit of fun-- 00:24:42.570 --> 00:24:44.820 I can try and blow up the balloon, for example. 00:24:44.820 --> 00:24:54.950 I'll connect these two blocks and every time I blow, 00:24:54.950 --> 00:24:57.860 that triggers the loudness threshold-- it goes above the 30-- 00:24:57.860 --> 00:25:00.260 and I've disconnected it for now so that the balloon doesn't get bigger 00:25:00.260 --> 00:25:01.885 and bigger while I'm talking right now. 00:25:01.885 --> 00:25:04.850 But every time the loudness goes above a particular threshold, 00:25:04.850 --> 00:25:07.130 well then the size of the balloon is going to change-- 00:25:07.130 --> 00:25:10.160 and you probably saw that balloon get a little bit bigger and bigger 00:25:10.160 --> 00:25:10.730 every time. 00:25:10.730 --> 00:25:13.813 And you can have fun with this playing around with that threshold deciding 00:25:13.813 --> 00:25:17.000 how loud something needs to be, or how quiet something needs to be in order 00:25:17.000 --> 00:25:19.680 to get a particular result to happen. 00:25:19.680 --> 00:25:24.170 And so loudness is another type of Event that Scratch will let you respond to. 00:25:24.170 --> 00:25:27.980 And just for one final example, notice here too that this loudness is 00:25:27.980 --> 00:25:31.640 a dropdown menu-- in the same way that pressing a key on the keyboard had 00:25:31.640 --> 00:25:33.290 a dropdown menu where I could say-- 00:25:33.290 --> 00:25:35.480 I don't just want the Scratch project to respond 00:25:35.480 --> 00:25:37.430 to when the space key is pressed, but I want 00:25:37.430 --> 00:25:40.310 it to respond to an arrow key, or a letter, or a number. 00:25:40.310 --> 00:25:42.620 I have another option here-- 00:25:42.620 --> 00:25:45.440 I can choose when loudness is greater than 30, 00:25:45.440 --> 00:25:48.590 or when Timer is greater than a particular number. 00:25:48.590 --> 00:25:51.530 And so every Scratch project, though we haven't seen it just yet, 00:25:51.530 --> 00:25:54.410 has a built-in timer and the timer is keeping 00:25:54.410 --> 00:25:58.832 track of how much time has passed since we started the project. 00:25:58.832 --> 00:26:01.790 So when the project starts, we start counting how much time has passed, 00:26:01.790 --> 00:26:04.680 and that timer is keeping track of that for us. 00:26:04.680 --> 00:26:07.460 And so originally, if you think back to our first program 00:26:07.460 --> 00:26:10.370 that we made earlier, where we had the cat and the dinosaur talking 00:26:10.370 --> 00:26:13.190 to each other and they both said hello at the same time, 00:26:13.190 --> 00:26:15.450 why did they both say hello at the same time? 00:26:15.450 --> 00:26:18.350 They both said hello at the same time because they 00:26:18.350 --> 00:26:21.260 were both responding to the same event, the When Flag 00:26:21.260 --> 00:26:23.000 Clicked Event that happened once. 00:26:23.000 --> 00:26:27.440 And as soon as I pressed the green flag, then both the cat and the dinosaur 00:26:27.440 --> 00:26:28.392 said hello. 00:26:28.392 --> 00:26:31.100 In an actual conversation, of course, they probably wouldn't both 00:26:31.100 --> 00:26:32.570 say hello at the same time-- 00:26:32.570 --> 00:26:37.310 the cat might say hello and the dinosaur might respond a few seconds later. 00:26:37.310 --> 00:26:39.650 And we can take advantage now of this Timer-- 00:26:39.650 --> 00:26:43.410 the ability to wait for the Timer to reach a particular number. 00:26:43.410 --> 00:26:46.820 And when the Timer reaches that number, then an Event 00:26:46.820 --> 00:26:51.660 is triggered-- that will let us time sprites a little bit more precisely. 00:26:51.660 --> 00:26:53.660 And so let's give that a try by going back 00:26:53.660 --> 00:26:56.690 to the project we created at the beginning of today. 00:26:56.690 --> 00:27:02.420 I'll delete the balloon, go into my sprites, and let's add our cat back-- 00:27:02.420 --> 00:27:04.490 we'll bring our cat over to the left. 00:27:04.490 --> 00:27:07.130 And I'll add one more sprite, I'll go ahead 00:27:07.130 --> 00:27:10.070 and bring our dinosaur back as well-- 00:27:10.070 --> 00:27:13.022 that dinosaur is going to have a rotation style of left right 00:27:13.022 --> 00:27:15.230 because I only want it to face the left or the right. 00:27:15.230 --> 00:27:18.690 And I'll change the direction to negative 90 00:27:18.690 --> 00:27:22.240 so that the cat and the dinosaur are facing each other. 00:27:22.240 --> 00:27:24.610 And for the cat, the code is going to be the same-- 00:27:24.610 --> 00:27:29.410 we'll have the cat respond to an Event, the Event will be When Flag Is Clicked, 00:27:29.410 --> 00:27:33.870 I want the cat to say hello for two seconds. 00:27:33.870 --> 00:27:36.330 But I want the dinosaur not to immediately say hello 00:27:36.330 --> 00:27:39.720 when the flag is clicked, but to wait for the cat-- let the cat say hello 00:27:39.720 --> 00:27:42.420 and then the dinosaur can respond. 00:27:42.420 --> 00:27:44.650 So under the dinosaur, instead of using the 00:27:44.650 --> 00:27:48.150 When Flag Clicked Event which would happen right away, 00:27:48.150 --> 00:27:55.150 I'm instead going to use them When Timer Is Greater Than 2. 00:27:55.150 --> 00:27:57.350 In other words, after the Timer reaches 2, 00:27:57.350 --> 00:28:00.910 in other words, after two seconds have passed in my project-- 00:28:00.910 --> 00:28:06.730 we'll then and only then should the dinosaur say hello for two seconds 00:28:06.730 --> 00:28:07.827 as well. 00:28:07.827 --> 00:28:09.160 And so now notice what happens-- 00:28:09.160 --> 00:28:15.890 I'll press the green flag, the cat says "hello" for two seconds, 00:28:15.890 --> 00:28:20.248 and only once the cat is done the dinosaur then says "hello" as well. 00:28:20.248 --> 00:28:22.040 And that's because the dinosaur is waiting, 00:28:22.040 --> 00:28:25.370 it's not going right when the project starts, it's waiting for the Timer 00:28:25.370 --> 00:28:26.300 to reach 2. 00:28:26.300 --> 00:28:30.530 And the Timer, again, begins every time we click on the green flag-- 00:28:30.530 --> 00:28:33.200 but when the green flag is clicked, the Timer resets back to 0, 00:28:33.200 --> 00:28:36.770 and it's counting up in terms of how many seconds have passed 00:28:36.770 --> 00:28:39.530 since the beginning of the project. 00:28:39.530 --> 00:28:42.773 And there are other events that we can use inside of Scratch as well that we 00:28:42.773 --> 00:28:43.940 haven't yet taken a look at. 00:28:43.940 --> 00:28:47.450 There's one here, for example, that checks when the backdrop switches 00:28:47.450 --> 00:28:48.800 to a particular backdrop. 00:28:48.800 --> 00:28:52.010 So recall before we had those various different backdrops with the Arctic, 00:28:52.010 --> 00:28:53.540 and the jungle, and underwater? 00:28:53.540 --> 00:28:57.770 You could add Events that say, as soon as the backdrop switches to underwater, 00:28:57.770 --> 00:29:00.480 then play those bubbles or the ocean sounds for example, 00:29:00.480 --> 00:29:02.810 or do some other action depending on what 00:29:02.810 --> 00:29:04.520 backdrop happens to be switched to. 00:29:04.520 --> 00:29:07.670 But you can hopefully now start to see how these events really 00:29:07.670 --> 00:29:10.970 start to make our Scratch projects more powerful and more interactive. 00:29:10.970 --> 00:29:14.990 We no longer need to say, run this block of code now, run that block of code 00:29:14.990 --> 00:29:15.500 now-- 00:29:15.500 --> 00:29:18.590 we can add Events to our project and let our project 00:29:18.590 --> 00:29:20.300 decide when to run that code. 00:29:20.300 --> 00:29:24.320 Letting it respond to when the project begins, or when we click on something, 00:29:24.320 --> 00:29:27.830 or when we press a key on the keyboard, or when the loudness changes, 00:29:27.830 --> 00:29:30.050 or any number of other different types of events 00:29:30.050 --> 00:29:32.630 that Scratch now gives us the ability to use. 00:29:32.630 --> 00:29:36.230 And hopefully now using Events, we'll be able to create all the more interesting 00:29:36.230 --> 00:29:38.297 and interactive projects as well. 00:29:38.297 --> 00:29:41.130 That's it for An Introduction to Programming with Scratch for today. 00:29:41.130 --> 00:29:44.210 Next time, we'll take these ideas and build up on them even more, 00:29:44.210 --> 00:29:46.000 see you then.