Here even now we also don't d d two functions now we will move to another function that will check catch
that feather there is a catch or not so define this function here and how a program can assume that
whether there's a check or not.
So the catch all no.
So for that when I have a very simple explanation just consider this for them and I'll tell you why
sodium didn't follow.
Now what do I say you that consider this folder just about this.
But then how.
You can assume that one will consider this one that I'm putting this folder on this spot.
So what is the condition for that.
It's very simple.
Just this left vault of this folder is greater than the left of this bar.
But the right of this folder is less than the very light of depart or simplify.
Consider this one here on the middle of the computer screen.
Then when it is in middle or say something here or here when the left by side of this folder is greater
than the left side of the window but its right is less than the right of veto.
So this is the first assumption we will take that the left part of a main item should be greater than
the left part of our catcher but the right overall item which is eg is less than the right of the catcher.
But if I say you that at this point at this point like if I have go for loss here then the both these
folders are about this but because their left portion is greater than the left but the right is less
than did right.
Only on the x axis so how the get is done.
So now we have a focus then when they are between the boundaries.
Now we will assume Devi X's that when the y axis it's bottom where the project is freedom became less
then the boundary of display.
So simply the egg fly do less then the catch of item then that will be the build condition when we have
a catch.
So let me make that in form of code then you will understand that one more better so fast.
What will I do here.
I will have four variables that will contain the catcher schooled in it.
First one catcher underscored X. Then we have catcher underscored why then catcher underscore x2.
Then catcher under school right.
And there will be simply c What coordinates of catcher maybe.
After that when we have the catcher coordinate No I will get the coordinates of every single thing.
So for that when I need to pass a loop here for again eggs novice students are thinking why I had not
written this one inside the loop because we have only one catcher but multiple X..
Now what will I do.
Sorry.
First I need to have the coordinates of egg.
So egg underscore X. Then egg underscore why then egg underscore x2 and egg under school wipe maybe.
So they will be simply sealed coordinates of egg made Eagle.
Now I will apply if condition in which I have the three condition that I have explained to you that
the
here I have the captured egg.
It must be less than the egg self egg or here we have just compare the left boundary that before the
left boundary must be greater than this left boundary and second condition.
What we have is this boundary must be less than this one so egg growth x2 must be less than catcher
of x2.
I think you are angry with me and the last condition we have the what we call difference.
So that is I am taking catcher why do minus of egg underscore white.
It must be less than safe for me.
So I have taken this 40 you to defend value here also but no greater than 50 then that will be a catch
very far away from the catcher.
Now after this one.
What will happen when there's a catch.
We simply remove the egg.
Increase discord and that's enough.
So to remove the egg we would just do simply the list again and remove.
Just like the drop and they're past the egg.
Maybe go after that one.
We also need to pass here.
Delete come on for the egg roll and in last increasing discord.
So for that one I'm just passing a function here so increased code and the value will be increased their
egg score.
That is we have taken 10.
So David we are in command of 10 now here we have defined this whole for one instant.
What that mean is like when I'm running this one C I have at this moment Twix and this catcher has check
whether there is a catch or not.
And you're still looking after that one even if you have catch it will not work because there is something
only happening once to make it happen again and again we need to again call dysfunction catch and just
go check.
Just like the others we have done so far.
So like the others windowed I think it's not properly intended.
Not perfect.
So windowed after and will dig up very small time gap here so that you will check at every instant.
This is one tenth of a second hundred millisecond then just go to the catch in the score check again
labial.
Now we are in the.
And after that one increasing discord that we have called here indicates in this goes score and pass
the points that actually the school and have developed an now just like their lives too meaning Davey
have just decreased the value of life by one.
Here we will increase discord by 10.
And after that one will also increase the speed and the interval pretty difficult effector so that the
game became harder and harder.
So first of all I'm taking these variables that we have scored.
Speed interval inside my loop.
So for that I will pass it global and one more thing maybe I have to defined global yet but I have used
in different programs.
So global is something many of you want to use a variable inside the function and also outside function.
The value will remain the same.
If I define score here that is something here zero net.
This will also be zero inside my function and other values also like the speed and to speed.
So this is same outside and inside the function with value 500 means I don't need to again define that
one inside this function.
However whenever we are defining the variables inside the function they are different from the outside.
So for same we use the global so sorry for that one if I have not defined this one for after that when
we have gone to scoring double and now let's begin.
First of all it's scored in command that under points that is a actual Well you have scored an equal
to Ben and after that 1 we have gone to school speed which is the indoor or regional speed.
Multiply by a difficulty factor 0 difficulty factor then we have eg underscored in Dublin which is going
to be in the 40s Dublin double
multiply by difficulty factor Dario.
Now we also done with that one not just configured the new score there.
So again see the item configure and pass the score on the score test which you want to configure and
text.
There will be first disc gold spaced notes and space plus this string of score
maybe.
Now we are also done with this.
So now just the emotions of the catch in our left wrist.
We have completed all the functions that we are going to require.
So in the next video we will cover that one and then our program is finished.