Hey everyone.
So now we are done with the defining dysfunctions and I'll just emotion is left.
So you know Ed Koch it would be why we have only two kinds of emotion right and left.
And for both of these days a condition labor and moving right then I can only just move up to right
until my ex to have this catch it at like this point is less than the total weight of this canvas and
I can move in left until my ex one of this catcher is always greater than this will or we can say zero.
So these are only two conditions.
We need to focus for the emotion.
No I will define two functions here.
First one is the move left and parse this one a barometer event after that one.
I will define move under school right.
And the same barometer event depend on the key.
I'm pissed.
So let's begin with the moving left and how will I move left.
I will take the coordinates of Cacho and if they are X1 grid then zero then I will move my catcher for
a certain distance.
And again this motion is not the actual motion.
It is just changing of position.
So I have here X1 y one and x2 y2 and these will be CDO coordinates of catcher.
And now if my X1 is greater than 0.
Only then I can move in left direction.
Then how we can change all the coordinates so for certain figure at a time.
Just see Don't move
by using this one we can move our program of a particular figure in any direction.
So that's just changing its actual position with the new coordinates.
So here what we want to move catcher so catcher and then 0.
Sorry this is moving in left direction when wanting to show you like when we are moving the eggs we
have taken zero to 10 and the position is actually spacing from zero to certain 10 pixels but here on
this schedule I'm moving right and left.
So the distance I'm going to take here is 20.
But wanting to focus man I'm moving in the right direction.
I will take this one as a positive 20 because X is increasing in this way.
But when I take this one in negative I have to take minus 20 because that is actually a negative motion
if we consider this one the center of our catcher.
So here we need to pass minus 20 to zero because we are not going from zero to quantify yet actually
coming back to zero from minus 20.
So this is about the left direction motion for the light just copy this one base ditch him and change
the condition whenever x2 is less than the canvas fit.
So here we have endless food living in that condition.
A positive 20 degree motion is going to be set in motion.
They will go with left and right.
Now we have defined all the functions.
The question here is what now.
So first of all we will pack the keys so that we can have the catch motion.
Then we will work on the rest.
Now this is a little different from the total graphics there we have used on keys.
Here we have a different metal bind.
So here we will use the bind metal to bind the keys with dysfunctions.
So how we will do that one just see what bind.
And the same like the old keys first provide the key and then provide the function.
But here you need to pass the key in these decades.
This is actually greater than and less than symbols.
So this one and inside this one just left for left key with El capital there.
So make sure all is capital then function move left tibial for right.
Just seed or bind again these and their bus right.
Maybe you and the function here will be more undisclosed right now for making sure that the Yankees
are pressed.
We also need to add one more method here that is seed or focus set so focus under so say.
So this is what you need to add him at this point if you run your program.
The data we have one to be Y.
There we go.
So here we have the catcher.
And there we have the motion working perfectly fine.
So disciplined right and got stopped when the extra is created and David and Ed reshape the left also.
There we go.
So we have the perfect motion on both sides.
Also this is going a little out of the window because we do not have actually the correct values for
the catcher.
We have something left from the original.
So David go with this one in the next video we will just combine all these functions so they can work
together.
So thanks for watching this about the keys and I was in the next video.