1 00:00:05,600 --> 00:00:16,810 Here even now we also don't d d two functions now we will move to another function that will check catch 2 00:00:17,260 --> 00:00:23,920 that feather there is a catch or not so define this function here and how a program can assume that 3 00:00:23,920 --> 00:00:25,260 whether there's a check or not. 4 00:00:25,450 --> 00:00:26,300 So the catch all no. 5 00:00:27,160 --> 00:00:33,240 So for that when I have a very simple explanation just consider this for them and I'll tell you why 6 00:00:33,720 --> 00:00:37,260 sodium didn't follow. 7 00:00:37,480 --> 00:00:41,690 Now what do I say you that consider this folder just about this. 8 00:00:41,710 --> 00:00:43,500 But then how. 9 00:00:43,500 --> 00:00:49,470 You can assume that one will consider this one that I'm putting this folder on this spot. 10 00:00:49,710 --> 00:00:51,730 So what is the condition for that. 11 00:00:52,650 --> 00:00:53,560 It's very simple. 12 00:00:53,610 --> 00:00:58,740 Just this left vault of this folder is greater than the left of this bar. 13 00:00:59,520 --> 00:01:05,800 But the right of this folder is less than the very light of depart or simplify. 14 00:01:05,810 --> 00:01:10,980 Consider this one here on the middle of the computer screen. 15 00:01:10,980 --> 00:01:20,130 Then when it is in middle or say something here or here when the left by side of this folder is greater 16 00:01:20,130 --> 00:01:24,570 than the left side of the window but its right is less than the right of veto. 17 00:01:25,260 --> 00:01:33,120 So this is the first assumption we will take that the left part of a main item should be greater than 18 00:01:33,630 --> 00:01:41,370 the left part of our catcher but the right overall item which is eg is less than the right of the catcher. 19 00:01:42,510 --> 00:01:50,940 But if I say you that at this point at this point like if I have go for loss here then the both these 20 00:01:50,940 --> 00:01:58,410 folders are about this but because their left portion is greater than the left but the right is less 21 00:01:58,410 --> 00:01:59,460 than did right. 22 00:01:59,520 --> 00:02:04,620 Only on the x axis so how the get is done. 23 00:02:05,110 --> 00:02:09,100 So now we have a focus then when they are between the boundaries. 24 00:02:09,100 --> 00:02:18,720 Now we will assume Devi X's that when the y axis it's bottom where the project is freedom became less 25 00:02:18,720 --> 00:02:21,520 then the boundary of display. 26 00:02:23,010 --> 00:02:32,670 So simply the egg fly do less then the catch of item then that will be the build condition when we have 27 00:02:32,670 --> 00:02:34,310 a catch. 28 00:02:34,380 --> 00:02:42,460 So let me make that in form of code then you will understand that one more better so fast. 29 00:02:42,910 --> 00:02:43,810 What will I do here. 30 00:02:44,230 --> 00:02:49,360 I will have four variables that will contain the catcher schooled in it. 31 00:02:49,390 --> 00:02:58,920 First one catcher underscored X. Then we have catcher underscored why then catcher underscore x2. 32 00:02:59,500 --> 00:03:02,700 Then catcher under school right. 33 00:03:03,490 --> 00:03:09,910 And there will be simply c What coordinates of catcher maybe. 34 00:03:10,570 --> 00:03:16,320 After that when we have the catcher coordinate No I will get the coordinates of every single thing. 35 00:03:16,360 --> 00:03:23,890 So for that when I need to pass a loop here for again eggs novice students are thinking why I had not 36 00:03:23,890 --> 00:03:28,750 written this one inside the loop because we have only one catcher but multiple X.. 37 00:03:29,140 --> 00:03:30,180 Now what will I do. 38 00:03:30,990 --> 00:03:31,550 Sorry. 39 00:03:31,630 --> 00:03:37,450 First I need to have the coordinates of egg. 40 00:03:37,510 --> 00:03:54,170 So egg underscore X. Then egg underscore why then egg underscore x2 and egg under school wipe maybe. 41 00:03:54,980 --> 00:04:01,450 So they will be simply sealed coordinates of egg made Eagle. 42 00:04:01,530 --> 00:04:08,520 Now I will apply if condition in which I have the three condition that I have explained to you that 43 00:04:08,520 --> 00:04:09,000 the 44 00:04:12,150 --> 00:04:15,100 here I have the captured egg. 45 00:04:15,790 --> 00:04:24,130 It must be less than the egg self egg or here we have just compare the left boundary that before the 46 00:04:24,130 --> 00:04:29,800 left boundary must be greater than this left boundary and second condition. 47 00:04:29,800 --> 00:04:42,130 What we have is this boundary must be less than this one so egg growth x2 must be less than catcher 48 00:04:42,150 --> 00:04:43,890 of x2. 49 00:04:43,900 --> 00:04:50,320 I think you are angry with me and the last condition we have the what we call difference. 50 00:04:50,350 --> 00:04:59,510 So that is I am taking catcher why do minus of egg underscore white. 51 00:04:59,560 --> 00:05:03,210 It must be less than safe for me. 52 00:05:03,250 --> 00:05:12,310 So I have taken this 40 you to defend value here also but no greater than 50 then that will be a catch 53 00:05:12,610 --> 00:05:13,910 very far away from the catcher. 54 00:05:15,720 --> 00:05:16,500 Now after this one. 55 00:05:17,040 --> 00:05:19,290 What will happen when there's a catch. 56 00:05:19,350 --> 00:05:20,760 We simply remove the egg. 57 00:05:20,830 --> 00:05:23,620 Increase discord and that's enough. 58 00:05:24,540 --> 00:05:29,190 So to remove the egg we would just do simply the list again and remove. 59 00:05:29,190 --> 00:05:33,580 Just like the drop and they're past the egg. 60 00:05:33,690 --> 00:05:35,440 Maybe go after that one. 61 00:05:35,880 --> 00:05:37,000 We also need to pass here. 62 00:05:37,010 --> 00:05:44,240 Delete come on for the egg roll and in last increasing discord. 63 00:05:44,250 --> 00:05:52,140 So for that one I'm just passing a function here so increased code and the value will be increased their 64 00:05:52,890 --> 00:05:54,020 egg score. 65 00:05:54,030 --> 00:05:56,830 That is we have taken 10. 66 00:05:57,430 --> 00:06:06,140 So David we are in command of 10 now here we have defined this whole for one instant. 67 00:06:06,140 --> 00:06:14,630 What that mean is like when I'm running this one C I have at this moment Twix and this catcher has check 68 00:06:14,630 --> 00:06:16,380 whether there is a catch or not. 69 00:06:16,620 --> 00:06:23,960 And you're still looking after that one even if you have catch it will not work because there is something 70 00:06:24,620 --> 00:06:30,860 only happening once to make it happen again and again we need to again call dysfunction catch and just 71 00:06:30,860 --> 00:06:32,270 go check. 72 00:06:32,270 --> 00:06:34,150 Just like the others we have done so far. 73 00:06:35,660 --> 00:06:40,800 So like the others windowed I think it's not properly intended. 74 00:06:46,450 --> 00:06:47,650 Not perfect. 75 00:06:47,680 --> 00:06:56,330 So windowed after and will dig up very small time gap here so that you will check at every instant. 76 00:06:56,330 --> 00:07:04,320 This is one tenth of a second hundred millisecond then just go to the catch in the score check again 77 00:07:04,920 --> 00:07:06,240 labial. 78 00:07:06,370 --> 00:07:07,330 Now we are in the. 79 00:07:08,530 --> 00:07:16,000 And after that one increasing discord that we have called here indicates in this goes score and pass 80 00:07:15,990 --> 00:07:24,860 the points that actually the school and have developed an now just like their lives too meaning Davey 81 00:07:24,900 --> 00:07:28,460 have just decreased the value of life by one. 82 00:07:28,480 --> 00:07:30,870 Here we will increase discord by 10. 83 00:07:31,020 --> 00:07:38,130 And after that one will also increase the speed and the interval pretty difficult effector so that the 84 00:07:38,130 --> 00:07:39,660 game became harder and harder. 85 00:07:40,790 --> 00:07:47,240 So first of all I'm taking these variables that we have scored. 86 00:07:47,560 --> 00:07:51,610 Speed interval inside my loop. 87 00:07:51,820 --> 00:07:58,270 So for that I will pass it global and one more thing maybe I have to defined global yet but I have used 88 00:07:58,270 --> 00:08:00,040 in different programs. 89 00:08:00,040 --> 00:08:07,300 So global is something many of you want to use a variable inside the function and also outside function. 90 00:08:07,350 --> 00:08:09,170 The value will remain the same. 91 00:08:09,180 --> 00:08:15,560 If I define score here that is something here zero net. 92 00:08:15,580 --> 00:08:24,230 This will also be zero inside my function and other values also like the speed and to speed. 93 00:08:24,230 --> 00:08:30,530 So this is same outside and inside the function with value 500 means I don't need to again define that 94 00:08:30,530 --> 00:08:32,330 one inside this function. 95 00:08:32,360 --> 00:08:37,220 However whenever we are defining the variables inside the function they are different from the outside. 96 00:08:37,700 --> 00:08:45,540 So for same we use the global so sorry for that one if I have not defined this one for after that when 97 00:08:45,540 --> 00:08:49,680 we have gone to scoring double and now let's begin. 98 00:08:49,690 --> 00:08:57,340 First of all it's scored in command that under points that is a actual Well you have scored an equal 99 00:08:57,340 --> 00:09:07,170 to Ben and after that 1 we have gone to school speed which is the indoor or regional speed. 100 00:09:07,180 --> 00:09:17,890 Multiply by a difficulty factor 0 difficulty factor then we have eg underscored in Dublin which is going 101 00:09:17,890 --> 00:09:19,960 to be in the 40s Dublin double 102 00:09:23,180 --> 00:09:26,480 multiply by difficulty factor Dario. 103 00:09:27,380 --> 00:09:31,510 Now we also done with that one not just configured the new score there. 104 00:09:32,420 --> 00:09:40,970 So again see the item configure and pass the score on the score test which you want to configure and 105 00:09:41,010 --> 00:09:41,580 text. 106 00:09:41,580 --> 00:09:49,920 There will be first disc gold spaced notes and space plus this string of score 107 00:09:53,920 --> 00:09:55,050 maybe. 108 00:09:55,500 --> 00:09:57,330 Now we are also done with this. 109 00:09:57,990 --> 00:10:00,780 So now just the emotions of the catch in our left wrist. 110 00:10:00,780 --> 00:10:03,360 We have completed all the functions that we are going to require. 111 00:10:04,110 --> 00:10:08,000 So in the next video we will cover that one and then our program is finished.