1
00:00:00,590 --> 00:00:02,880
Now that we've built the gameboard, we've built the deck.

2
00:00:02,910 --> 00:00:07,190
We've shuffled the deck, let's add in adding the button clickers.

3
00:00:07,210 --> 00:00:08,520
So create another function.

4
00:00:09,150 --> 00:00:13,740
And is just a series of commands here that we're gonna have that are going to do all of functionality

5
00:00:13,740 --> 00:00:14,310
for the game.

6
00:00:15,360 --> 00:00:16,770
So add clicker.

7
00:00:17,530 --> 00:00:20,250
It's gonna add the ability to click on the buttons.

8
00:00:20,650 --> 00:00:23,230
And we already have all of the buttons created.

9
00:00:23,670 --> 00:00:26,010
And we have them as objects within the game object.

10
00:00:26,370 --> 00:00:30,930
So now it's just a matter of connecting to those buttons and adding the functionality that we want.

11
00:00:31,530 --> 00:00:33,150
So let's create a bunch of functions.

12
00:00:33,260 --> 00:00:36,120
They're going to add the functionality for clicking.

13
00:00:36,810 --> 00:00:44,160
So first we've got the button BEATTIES and deal object and add of that listener.

14
00:00:44,480 --> 00:00:50,130
So that listener that we're adding force are gonna listen for a click on that object and that's going

15
00:00:50,130 --> 00:00:54,990
to initiate the function called deal and we can create that function for that.

16
00:00:55,600 --> 00:00:57,120
So just function deal.

17
00:00:57,820 --> 00:01:03,870
We can do the same thing for the other buttons where we can add in all the different functionality that

18
00:01:03,870 --> 00:01:04,230
we want.

19
00:01:04,740 --> 00:01:07,640
So we had another button that was button stand.

20
00:01:08,650 --> 00:01:11,130
So making all of the buttons playable.

21
00:01:11,880 --> 00:01:16,530
How about we call this one player stand and let's do a few other buttons.

22
00:01:16,980 --> 00:01:18,240
We've got button hit.

23
00:01:19,680 --> 00:01:25,740
And these, of course, are very crucial part to playing the game where we want the player to have the

24
00:01:25,740 --> 00:01:28,770
ability to interact with what's happening on the screen.

25
00:01:29,280 --> 00:01:31,080
So player, next card.

26
00:01:31,530 --> 00:01:32,910
And then let's say that.

27
00:01:33,000 --> 00:01:35,680
So we need to create the functions in order to handle that.

28
00:01:35,940 --> 00:01:41,170
So we don't have functions for player stand and for next card as we were throwing that error.

29
00:01:41,900 --> 00:01:43,200
So player stand.

30
00:01:43,860 --> 00:01:49,920
And this would just be kind of like placeholder functions as we're building this to come back to later

31
00:01:49,920 --> 00:01:50,070
on.

32
00:01:50,190 --> 00:01:52,140
So see that and no more error.

33
00:01:52,290 --> 00:01:54,750
So that means that we're ready to continue to build this.

34
00:01:55,320 --> 00:01:59,010
So what we wanted to do is be able to deal out the cards.

35
00:01:59,880 --> 00:02:04,200
And so let's start building what we need for deal and move this up a bit.

36
00:02:04,640 --> 00:02:05,670
So it's easier to see.

37
00:02:06,180 --> 00:02:06,840
So top.

38
00:02:08,150 --> 00:02:09,230
And coming in.

39
00:02:10,070 --> 00:02:14,750
Let's clear out whatever might be within the dealer hand.

40
00:02:15,060 --> 00:02:19,280
So a build out that the dealer hand object.

41
00:02:19,850 --> 00:02:23,180
And this is whatever the contents of the dealer hand is going to be.

42
00:02:23,480 --> 00:02:24,360
And player hand.

43
00:02:25,190 --> 00:02:31,700
So this will allow us to continue and build another round into the game where we're gonna be able to

44
00:02:31,730 --> 00:02:33,860
clear whatever the existing hands are.

45
00:02:34,190 --> 00:02:35,780
And take additional cards.

46
00:02:36,410 --> 00:02:39,410
I'm going to also create one that's called game start.

47
00:02:39,980 --> 00:02:46,220
So it means that the game is in play and no more betting closing off the betting and that sort of thing.

48
00:02:46,490 --> 00:02:49,550
So give us the ability to kind of turn and disable things.

49
00:02:50,300 --> 00:02:53,750
And then the game, there's the player cards.

50
00:02:54,950 --> 00:02:56,830
So let's update the inner H.

51
00:02:56,900 --> 00:02:57,400
Timal.

52
00:02:58,030 --> 00:02:59,810
And for now, we're just put deal.

53
00:03:01,090 --> 00:03:04,080
And we're going to update this, obviously, with cards later on.

54
00:03:05,010 --> 00:03:06,730
And same for the dealer hands.

55
00:03:07,230 --> 00:03:07,770
So deal.

56
00:03:08,330 --> 00:03:09,730
So to see what happens, sir, refresh.

57
00:03:10,200 --> 00:03:10,620
Deal.

58
00:03:10,860 --> 00:03:13,200
And we get the contents being updated.

59
00:03:13,290 --> 00:03:16,620
So you see that through the contents are updating within the play area.

60
00:03:17,100 --> 00:03:18,060
So we need to add in.

61
00:03:18,090 --> 00:03:21,720
Cards in there and we need to play the whole game play affect.

62
00:03:22,500 --> 00:03:26,040
So we also need to disable the ability for a hit and stand.

63
00:03:26,340 --> 00:03:29,790
And we also need to disable those buttons by default.

64
00:03:30,150 --> 00:03:34,270
So we're gonna have another function that we're going to set up in the next lesson, which is going

65
00:03:34,270 --> 00:03:39,090
to be able to toggle some of these buttons to have the right gameplay, because we don't want the player

66
00:03:39,090 --> 00:03:46,350
to be able to come in and hit to bet hit and stand when they have no cards being output yet.

67
00:03:46,920 --> 00:03:49,200
So that's all going to come in the upcoming lessons.

68
00:03:49,500 --> 00:03:52,410
So go ahead and add in the ability to deal.

69
00:03:52,830 --> 00:03:56,220
Make sure that your deal button is working and running.

70
00:03:56,400 --> 00:04:01,680
And you can also check the hit and stand can out in a console message whenever these buttons get clicked

71
00:04:01,980 --> 00:04:05,880
for the actions to make sure that you've got the actions and that they're ready to go and you can be

72
00:04:05,880 --> 00:04:11,100
ready to move on to the next lesson where we're going to disable the buttons that aren't in play and

73
00:04:11,100 --> 00:04:12,360
that aren't available to the player.
