Here even so now we have created our main body for almost screen pet.
And now we will move to create some of its functionalities like blinking of eyes in this video and then
rest in the next videos.
So in this video we will cover blinking of eyes and if we have a proper look and it we focus on the
walking.
Then you will notice that here when this one is blinking his eyes actually what is happening there.
The pupils they are at present in normal state.
They get hidden and the bedroom color that is right in the eyes becomes equal to body color.
So that's what actually happening here.
And this one seems like blinking of eyes.
So let me show that how that is working with a function here.
Then you will understand this one better.
So here if you notice on this one we have tuple there we have this the eyes and tuples.
What we will do will change the colors so let's begin with that one.
First of all I will define a function to the realize to Dougal underscored eyes.
And what will happen in this function.
I will first take the collateral file that is at present so current underscored color and how I get
the color.
That is very simple.
I will use items to get better so see what items we get.
So by using this method you can get any of these things that you require from your canvas.
So what I want there.
Take any of the idea like left or right time taking left one because both have the same color.
It's filled so there we have on the I feel so I am just taking value of this field and after that one
I will define a new color.
And that will be equal to the opposite of the color that is at present.
Like if the eye is closed then at present day color is the body color.
Otherwise the killer is white.
So new color is equal to see the body underscored color.
If my current color.
Equal to white I hope you get this one that my new color will became body color that is blue.
Only if my current color is equal to white otherwise became white.
So a little hard to understand but very easy.
Let me show you what I mean like if this is right now white then became bald eagle.
And if it is not white it is body color then just became white I hope you get this for now.
Again the new color variable will be equal to body color.
If my present color that is at that instant is white.
Otherwise if it is blue it will become white.
So I have just added this hole in the line.
That's why it's a little hard to understand here.
After this one I will focus on pupils just like here I have taken the new color there.
I will take a new state because he already I have the blue color on the computer I know you don't want
to change the color of pupil from black to like blue I will just change it straight from normal to be
done so that it will not be visible and this eye color will make like this is a closed.
So if we also focus on of a screen let anyone notice the event is either closing pupils are actually
hiding and the complete eye color become like body color.
So that's what we are going to do here.
I will take a valuable current underscore state.
There we go.
And this will be able to see what items get and there we have the pupil right and left there to Bill.
Actually that pupil here watching them to pupil.
Now we also don't mention here this state because that is by default normal one.
So don't panic about that then.
Now here pass any of these.
People say you believed in what we knew there state maybe your and then new state will be equal to normal
if my original state at present that is current state equal to hidden.
Otherwise if it is normal right now then hidden.
So again a conditional variable using if condition so that's how you can take variables that have two
different values depending on the situation.
So I hope you get these two after that one.
What will I do.
I will just configured the items to new state.
All of these.
So see Dot item configure.
They will.
And first of all I will take the pill left and right adjusted new state
news.
You go.
Then just copy this whole base this one here.
Change the bill bill.
Right there we go again I left and new color copied this one based this on here and I right now this
condition will make the eye closed ones like it will take the eye color which is at present
white so it will just make this one like body color And these hidden for once.
Now few students are thinking what if this one take color white and current state hidden right now.
Then it will be like blue eye and black dots there but that's not what it's civil because we're starting
our initial stages.
Normal pupils here and white eyes so it we just take white color and then the new global equal to both
regular and new state will equal to hidden because at present their normal.
But this one is called only once.
So what will I do here now.
I will define another function blink
and what will happen in that one.
I will call the toggle function that is toggle the school eyes.
There we go and I will just again call this one windowed after said 250 milliseconds
so that it will again again goes on.
And then again after
say 3000 milliseconds I will make recursion here by calling this function again.
So I would just call here blink so I hope you get this one by to make this function call again and again
by a specific period of time.
In this way we will get a blink Videla get.
So this is about making this one.
And we are done with blinking the eyes in the next video.
We will focus on the time.
So thanks for watching.
And I will see in the next video.