1 00:00:00,300 --> 00:00:08,480 Well, today we are going to do a project using Scratch. 2 00:00:08,480 --> 00:00:22,300 So the first thing that we must do is go to our account on the internet or the Scratch 3 00:00:22,300 --> 00:00:30,219 that we have online and open it, obviously. 4 00:00:30,219 --> 00:00:43,899 The project that we are going to do can be called Apple Catcher because in it, as you 5 00:00:43,899 --> 00:00:54,320 can see in this example, we are going to catch apple. 6 00:00:54,320 --> 00:01:06,780 The game must be able to catch the apples which are falling all the time and each time 7 00:01:06,780 --> 00:01:11,319 that you catch an apple you get a point. 8 00:01:11,319 --> 00:01:21,939 So it's very easy but you must do, you must create, so you need to be creative if you 9 00:01:21,939 --> 00:01:34,659 want. Firstly, first of all, what we must do is create a new project and choose the 10 00:01:34,659 --> 00:01:42,040 background and also the sprites. There are a lot of backgrounds in the library 11 00:01:42,040 --> 00:01:51,640 but if you want you can upload a photo, a picture that you can have in your 12 00:01:51,640 --> 00:01:59,500 computer. Another thing that you can also do is change some things in the picture 13 00:01:59,500 --> 00:02:09,879 that you have chosen. For example you can add some letters or a name or you can 14 00:02:09,879 --> 00:02:19,180 change for example some color. You can also need to choose the sprites. At least 15 00:02:19,180 --> 00:02:28,900 you need two the ball and the apple and you can get you can add it from the 16 00:02:28,900 --> 00:02:35,800 library both of them are in their library but if you want you can use 17 00:02:35,800 --> 00:02:44,919 another thing you can use other sprite that you can have in the 18 00:02:44,919 --> 00:02:54,520 library that aren't the ball and really an apple you can use a ball you can use whatever and as 19 00:02:54,520 --> 00:03:02,919 the same as same as in the scenery you can change its appearance indeed it goes for you to change 20 00:03:02,919 --> 00:03:16,960 disappearance, using this tool that can change from bitmap to vectorial way. 21 00:03:16,960 --> 00:03:30,939 As you know, bitmap is a set of pixels and vectorial is different, but both are 22 00:03:30,939 --> 00:03:39,680 digital imaging and the difference came from the way the 23 00:03:39,680 --> 00:03:49,840 computer can create the images in its screen. Well, other thing that is 24 00:03:49,840 --> 00:04:02,259 important that you can choose and change if you want our sounds so you can get 25 00:04:02,259 --> 00:04:10,400 some from the library of sounds and you can choose the sounds you want and also 26 00:04:10,400 --> 00:04:19,240 as imagined you can change some values and change the the sounds that you have 27 00:04:19,240 --> 00:04:33,060 get from the library so when we have we have chosen and we have customized the 28 00:04:33,060 --> 00:04:42,560 the background the sprites and the sounds of our project we were going to 29 00:04:42,560 --> 00:04:54,240 to add code. As we have already studied, the flowchart is the first part of the 30 00:04:54,240 --> 00:05:01,579 design in programming. So it's very useful for you that you draw a flowchart 31 00:05:01,579 --> 00:05:09,560 for each sprite. In this case we have two sprites which are the 32 00:05:09,560 --> 00:05:18,259 ball and the apple. And as we have already studied in class, the first step 33 00:05:18,259 --> 00:05:26,060 in any algorithm is the initial conditions. It's very important that you 34 00:05:26,060 --> 00:05:36,620 choose the initial conditions, otherwise when you reinitiate your program it 35 00:05:36,620 --> 00:05:46,439 doesn't work properly so it's very important that you you start to begin 36 00:05:46,439 --> 00:05:57,680 initiating the position of the ball and the Apple in the in the screen to do 37 00:05:57,680 --> 00:06:08,540 this the best thing that you can do is using the coordinates of the scratch 38 00:06:08,540 --> 00:06:23,660 screens. Scratch screens goes from a minus 255 to 255 in a horizontal and in 39 00:06:23,660 --> 00:06:34,220 vertical directions. So, taking this into consideration, you can know the limits of 40 00:06:34,220 --> 00:06:43,740 the movements of the objects in your screen. And it's very, very important, as we are going to see. 41 00:06:43,740 --> 00:06:47,100 well 42 00:06:47,100 --> 00:06:51,500 I changed the sounds 43 00:06:51,500 --> 00:08:07,800 well 44 00:08:07,800 --> 00:08:11,399 so we are going to 45 00:08:11,399 --> 00:08:13,399 initiate the 46 00:08:13,399 --> 00:08:15,360 the 47 00:08:15,360 --> 00:08:27,680 the sprites and to do this you go to the category events and you must choose the 48 00:08:27,680 --> 00:08:36,519 green flag and taking the coordinates into consideration for the ball and for 49 00:08:36,519 --> 00:08:50,440 For the apple you have the condition of the initiate programs. 50 00:08:50,440 --> 00:08:58,320 So after that we can start with the ball. 51 00:08:58,320 --> 00:09:05,460 Ball is going to be controlled using key arrows. 52 00:09:05,460 --> 00:09:16,750 indeed the left and the right arrows so it's very easy think in the code 53 00:09:18,990 --> 00:09:32,590 yes obviously when you push the right arrow you move 20 steps or whatever and when you 54 00:09:32,590 --> 00:09:44,529 You click and push the left arrow, the same part, if you want that the sense is opposite 55 00:09:44,529 --> 00:09:53,669 you need to put the sign ball, the symbol, the sign ball minus, the sign of the thing. 56 00:09:53,669 --> 00:09:59,830 So now you can control the ball, it's very easy. 57 00:09:59,830 --> 00:10:19,110 And for the apple is a little bit more difficult, not so much, but a little bit more difficult, because you want that the apple falls. It means that you need to change the coordinate, the vertical coordinate. 58 00:10:19,110 --> 00:10:39,110 And to do this is Y, but in the down direction, so using the sign, using the minus sign. 59 00:10:39,110 --> 00:10:51,580 And you need to do until the apple touches the floor. 60 00:10:51,580 --> 00:10:58,740 So you can do repeating this operation. 61 00:10:58,740 --> 00:11:07,399 And to repeat you can use repeat, the block repeat, or if you want, forever. 62 00:11:07,399 --> 00:11:16,559 But if you have chosen FOREVER, the problem is that the apple disappears. 63 00:11:16,559 --> 00:11:22,879 So you need to include in FOREVER a conditional. 64 00:11:22,879 --> 00:11:31,779 That means that when it touches the edge, it returns to the initial position. 65 00:11:31,779 --> 00:11:41,240 But if you just only go to the initial position, the horizontal position is always the same. 66 00:11:41,240 --> 00:11:53,379 So to change the position you can use the average between 200 and minus 200. 67 00:11:53,379 --> 00:12:02,279 And in this way you can have the ball and its movements under control and good movements 68 00:12:02,279 --> 00:12:04,100 for the apple. 69 00:12:04,100 --> 00:12:15,159 And this is all for today, for the next step, as you can see in this tutorial. 70 00:12:15,159 --> 00:12:28,600 Next day we are going to add something about what happened when the apple touched the ball 71 00:12:28,600 --> 00:12:34,720 and also how you do a counter. 72 00:12:34,720 --> 00:12:43,240 I hope you can enjoy this project because I think it's good for your creative and for 73 00:12:43,240 --> 00:12:44,240 you. 74 00:12:44,240 --> 00:12:46,240 I'll see you next time