1
00:00:00,460 --> 00:00:05,200
This lesson we're going to be checking to see if the player has selected the right word and if they

2
00:00:05,200 --> 00:00:06,620
are, then we're going to move them along.

3
00:00:06,790 --> 00:00:11,290
So instead of just simply grabbing whatever word and always moving it along, we're going to make our

4
00:00:11,290 --> 00:00:12,300
condition here.

5
00:00:12,380 --> 00:00:15,280
We're going to be checking to see if the word is correct.

6
00:00:15,460 --> 00:00:19,740
And we already have the word available within the word value there.

7
00:00:19,750 --> 00:00:23,380
So within the Divx word so we can say Divx word.

8
00:00:23,530 --> 00:00:33,280
And if this is equal to whatever the value of my words current is, then we know that this is correct.

9
00:00:33,970 --> 00:00:37,360
And if it's not correct, then we can do something else there.

10
00:00:37,510 --> 00:00:39,220
So this is essentially the win condition.

11
00:00:39,370 --> 00:00:44,620
And if it is correct that we want to move them along to the next word, we also need to have a check

12
00:00:44,770 --> 00:00:52,060
to see if and over here I just going to console lock out and over here, let's cancel out.

13
00:00:52,060 --> 00:00:52,480
Right.

14
00:00:53,050 --> 00:00:57,750
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.

15
00:00:58,150 --> 00:01:01,840
So going through hit start, we see select the word Lowrance.

16
00:01:02,080 --> 00:01:04,510
So that looks like this one isn't Lowrance.

17
00:01:04,540 --> 00:01:09,610
So we get wrong and we can click a whole bunch of wrong ones and then when we select the right one,

18
00:01:09,610 --> 00:01:10,330
we get right.

19
00:01:10,480 --> 00:01:11,260
So that's working.

20
00:01:11,260 --> 00:01:12,900
We're able to check the correct one.

21
00:01:13,240 --> 00:01:17,350
And now that we've checked the correct one, we see that we can also move through the different words.

22
00:01:17,590 --> 00:01:23,290
And as we're incrementing and moving through the different words where we're writing this next word,

23
00:01:23,410 --> 00:01:27,390
we need to check to see if there's actually a word existing.

24
00:01:27,400 --> 00:01:29,470
And this is where we can do that and condition.

25
00:01:29,800 --> 00:01:39,540
So checking to see if the value of current is greater than or equal to the value of my words length.

26
00:01:39,550 --> 00:01:41,760
And we know that every array has a length value.

27
00:01:42,220 --> 00:01:47,290
And if it is, then we're going to output a message of game over.

28
00:01:48,620 --> 00:01:54,290
And otherwise, we're going to continue with the messages for the players to keep playing.

29
00:01:54,570 --> 00:01:55,310
So let's try that out.

30
00:01:57,020 --> 00:01:57,620
So start.

31
00:01:58,040 --> 00:02:04,640
So find JavaScript, so it's right, we move on to the next word, of course, and if we get it wrong,

32
00:02:04,640 --> 00:02:07,520
then we don't move on to the next word until we get it right.

33
00:02:07,580 --> 00:02:11,000
So, Lawrence, is this one Cotting?

34
00:02:11,660 --> 00:02:16,580
And lastly, we've got brackets and then we get game over.

35
00:02:16,700 --> 00:02:20,540
So we should stop the functionality of being able to select the next word.

36
00:02:20,660 --> 00:02:22,520
And we don't have a word in play right now.

37
00:02:22,610 --> 00:02:28,970
So really the game over function should discontinue the ability to click the elements and to update

38
00:02:28,970 --> 00:02:29,990
them and so on.

39
00:02:30,260 --> 00:02:36,980
So now let's see how many wrong we can also have a score of how many wrong, how many were wrong.

40
00:02:37,100 --> 00:02:42,340
And we can also add in a timer as well to see how quickly the player can move through all of the words.

41
00:02:42,740 --> 00:02:45,560
So all of that is still yet to come in the upcoming lessons.

42
00:02:45,770 --> 00:02:49,570
And we also need to discontinue the ability to continue playing the game.

43
00:02:49,790 --> 00:02:55,400
So we need to have a start over, start button again and just simply stop the ability to play through

44
00:02:55,400 --> 00:02:55,710
the game.

45
00:02:55,940 --> 00:02:57,320
So all of that is still yet to come.

46
00:02:57,560 --> 00:03:02,030
Next ad in the messaging and the game over functionality.

47
00:03:02,240 --> 00:03:05,360
And we're going to conclude this application, the upcoming lesson.
