This lesson we're going to be checking to see if the player has selected the right word and if they
are, then we're going to move them along.
So instead of just simply grabbing whatever word and always moving it along, we're going to make our
condition here.
We're going to be checking to see if the word is correct.
And we already have the word available within the word value there.
So within the Divx word so we can say Divx word.
And if this is equal to whatever the value of my words current is, then we know that this is correct.
And if it's not correct, then we can do something else there.
So this is essentially the win condition.
And if it is correct that we want to move them along to the next word, we also need to have a check
to see if and over here I just going to console lock out and over here, let's cancel out.
Right.
And we'll go in and we'll try that before we move on to the next part where we've got a wind condition.
So going through hit start, we see select the word Lowrance.
So that looks like this one isn't Lowrance.
So we get wrong and we can click a whole bunch of wrong ones and then when we select the right one,
we get right.
So that's working.
We're able to check the correct one.
And now that we've checked the correct one, we see that we can also move through the different words.
And as we're incrementing and moving through the different words where we're writing this next word,
we need to check to see if there's actually a word existing.
And this is where we can do that and condition.
So checking to see if the value of current is greater than or equal to the value of my words length.
And we know that every array has a length value.
And if it is, then we're going to output a message of game over.
And otherwise, we're going to continue with the messages for the players to keep playing.
So let's try that out.
So start.
So find JavaScript, so it's right, we move on to the next word, of course, and if we get it wrong,
then we don't move on to the next word until we get it right.
So, Lawrence, is this one Cotting?
And lastly, we've got brackets and then we get game over.
So we should stop the functionality of being able to select the next word.
And we don't have a word in play right now.
So really the game over function should discontinue the ability to click the elements and to update
them and so on.
So now let's see how many wrong we can also have a score of how many wrong, how many were wrong.
And we can also add in a timer as well to see how quickly the player can move through all of the words.
So all of that is still yet to come in the upcoming lessons.
And we also need to discontinue the ability to continue playing the game.
So we need to have a start over, start button again and just simply stop the ability to play through
the game.
So all of that is still yet to come.
Next ad in the messaging and the game over functionality.
And we're going to conclude this application, the upcoming lesson.