1
00:00:00,150 --> 00:00:05,880
We need to show the player the word that they need to find from that grid of words that we have that

2
00:00:05,880 --> 00:00:07,230
are all scrambled up.

3
00:00:07,380 --> 00:00:10,080
So we need a way to display that word to the player.

4
00:00:10,230 --> 00:00:11,640
So select this word.

5
00:00:11,760 --> 00:00:14,270
But we actually also should do select this word.

6
00:00:14,280 --> 00:00:17,490
And so the word that we're want to select.

7
00:00:17,760 --> 00:00:23,280
So adding that in and the word player is going to be looking for is going to be the first word in the

8
00:00:23,280 --> 00:00:23,630
array.

9
00:00:23,850 --> 00:00:29,280
And we also need a way to kind of move through all of the words from the array so we can start out with

10
00:00:29,550 --> 00:00:33,000
value of current and set that to zero.

11
00:00:33,600 --> 00:00:40,410
And when we start the game, then we can make sure that current is set at zero and we're going to update

12
00:00:40,410 --> 00:00:42,840
and output that value of the word.

13
00:00:43,750 --> 00:00:50,560
So moving along and as we select the right word, we're going to increase the value of current and then

14
00:00:50,560 --> 00:00:52,980
show the next word in the order.

15
00:00:53,530 --> 00:00:59,000
So instead of having it happen here, we need to just send over a function in order to accommodate that.

16
00:00:59,560 --> 00:01:04,330
So taking that value of function and we just call it next word.

17
00:01:04,480 --> 00:01:10,030
So it's going to simply output whatever the next word is in order and it's going to take the value of

18
00:01:10,030 --> 00:01:11,960
current and output that value.

19
00:01:12,500 --> 00:01:15,130
So it's going to be a global variable so we can always access it.

20
00:01:15,610 --> 00:01:20,350
So what's going to happen here is that we're going to output the value of next word.

21
00:01:20,770 --> 00:01:25,860
And the way that that works is we're going to take that message and output it here.

22
00:01:26,080 --> 00:01:34,090
And right now it's going to take the my words array and simply update and output the word that we're

23
00:01:34,090 --> 00:01:34,930
on currently.

24
00:01:36,140 --> 00:01:42,650
And you can see that when I take next word, that I can output that message to the player and then also

25
00:01:42,650 --> 00:01:48,320
I can output that message to the player here as well, although here we're going to increment the next

26
00:01:48,320 --> 00:01:49,350
word by one.

27
00:01:49,880 --> 00:01:53,120
So let's try that out and going in, press the button.

28
00:01:53,390 --> 00:01:59,360
So select the word LOWRANCE So we need to make sure that the player can click the words next.

29
00:01:59,390 --> 00:02:01,280
They're going to be selecting brackets.

30
00:02:01,880 --> 00:02:06,980
So this one is brackets and we need to check to make sure that it is correct before we move them along.

31
00:02:07,550 --> 00:02:11,960
We've got next word undefined because we ran through the array and this is the point where the game

32
00:02:11,960 --> 00:02:12,520
concludes.

33
00:02:12,950 --> 00:02:19,520
So next up, we need to make sure that we're checking to see if the player is actually selecting the

34
00:02:19,520 --> 00:02:22,280
right word before we move on to the next word.

35
00:02:22,430 --> 00:02:27,140
And if they're not, then we're just going to say wrong and let them move on to the next word.

36
00:02:28,100 --> 00:02:31,010
And we're going to add that into in the next lesson.

37
00:02:31,160 --> 00:02:35,180
So for now, go ahead and create a function that's going to move us along to the next word.
