1
00:00:00,450 --> 00:00:06,780
This lesson, we're going to create a function to handle turning on and off buttons, so passing in

2
00:00:06,840 --> 00:00:08,700
whatever button object that we want.

3
00:00:09,090 --> 00:00:11,160
And this one will turn it off.

4
00:00:11,450 --> 00:00:13,740
And will you create another function that will turn it on?

5
00:00:14,100 --> 00:00:21,580
So it's going to select the whatever button object is passed in and apply disabled to it and set disabled.

6
00:00:21,600 --> 00:00:23,640
To be true because we're turning it off.

7
00:00:23,880 --> 00:00:29,100
So that's going to allow the player not to be able to interact with it and then us updating the style.

8
00:00:29,100 --> 00:00:35,520
So it's a visual as well that the color of the button text is going to change.

9
00:00:35,910 --> 00:00:42,660
And we'll have another function that will be turn on and passing in whatever button it is.

10
00:00:42,720 --> 00:00:44,610
So the button objects from the elements.

11
00:00:44,820 --> 00:00:48,450
So we can use that for any one of the buttons and we can simply turn them on and off.

12
00:00:48,930 --> 00:00:54,960
And this one will be disabled, will be false, and we'll turn the color back to just split.

13
00:00:55,380 --> 00:00:58,890
So now we can turn buttons on and off as needed.

14
00:00:59,340 --> 00:01:08,910
So once a deal is hit, we're going to turn off the game button, deal, object.

15
00:01:10,500 --> 00:01:16,860
And when we press deal, we see that the button goes, Gry, and it's no longer clickable.

16
00:01:17,400 --> 00:01:24,870
And we also need to turn off the hytten stand buttons before we launch the game.

17
00:01:25,440 --> 00:01:35,880
So going into an I.T., once we build the gameboard, let's turn off the button hit as we don't want

18
00:01:35,880 --> 00:01:39,780
someone to be able to take a hit because it's not going to be a valid.

19
00:01:39,960 --> 00:01:45,290
So we're turning those off and also turning off stand as an option.

20
00:01:45,300 --> 00:01:46,860
So we load the game.

21
00:01:47,190 --> 00:01:52,060
We have an option to bet the amount and we an option to deal and we would press deal.

22
00:01:52,290 --> 00:01:58,560
Then we lose the option to deal again because we're then the game is in play and we need to take cards

23
00:01:58,890 --> 00:02:01,500
and update the content and the gameplay.

24
00:02:02,340 --> 00:02:06,990
That's coming up next, where we're going to update and have the ability to take a card.

25
00:02:07,680 --> 00:02:12,450
And as well, we're going to re-enable the buttons to hit and stand.

26
00:02:12,840 --> 00:02:14,220
Depending on the calculations.

27
00:02:14,260 --> 00:02:21,120
We'll do a calculation within the deal that afterwards it's dealt that the player can take either if

28
00:02:21,120 --> 00:02:24,620
they have an ability to take a card that will re-enable the hit and stand.

29
00:02:25,170 --> 00:02:27,330
So that's all still to come in the upcoming lessons.

30
00:02:27,630 --> 00:02:33,870
So go ahead and add in these useful functions where we can turn on and off the various.

31
00:02:35,220 --> 00:02:37,200
Buttons in the gameplay.
