1
00:00:00,060 --> 00:00:02,400
When you're developing a game from scratch.

2
00:00:02,760 --> 00:00:04,780
Look at the flow of the gameplay.

3
00:00:05,280 --> 00:00:08,610
So take it from the player's perspective where they come into the game.

4
00:00:09,030 --> 00:00:12,210
The first action that they want to take is deal.

5
00:00:12,330 --> 00:00:17,610
And, of course, where you are going to look at adding in the bets later on once we get the gameplay

6
00:00:17,670 --> 00:00:18,090
working.

7
00:00:18,660 --> 00:00:21,000
And then the next action that the player has.

8
00:00:21,210 --> 00:00:21,990
They have an option.

9
00:00:22,050 --> 00:00:23,670
They can either hit or stand.

10
00:00:23,910 --> 00:00:25,240
The deal is already grayed out.

11
00:00:25,290 --> 00:00:27,090
So they don't have an option to hit a deal again.

12
00:00:27,420 --> 00:00:31,950
And we already are providing that option to them as stand or take another card.

13
00:00:32,220 --> 00:00:34,470
And that's the two options that the player has.

14
00:00:34,800 --> 00:00:38,610
And while they're still under 21, they can continue to play the game.

15
00:00:38,910 --> 00:00:44,100
So we need to assign some type of action to those clicks.

16
00:00:44,460 --> 00:00:46,800
And we've got the player stand.

17
00:00:47,100 --> 00:00:49,950
So that's looking for a function called player stand.

18
00:00:50,260 --> 00:00:52,530
And we've already created that as a placeholder.

19
00:00:53,040 --> 00:00:54,330
So let's grab those.

20
00:00:54,420 --> 00:00:55,410
We'll move those up.

21
00:00:56,010 --> 00:00:58,920
So these were the previous placeholders that we added.

22
00:00:58,940 --> 00:01:05,370
And so Player Next actually was will account for taking a hit first.

23
00:01:05,460 --> 00:01:08,430
And that's whenever the player needs to take the next card.

24
00:01:09,150 --> 00:01:11,670
They're going to run the function next card.

25
00:01:12,690 --> 00:01:14,520
And we've got a place holder for that.

26
00:01:14,730 --> 00:01:16,350
So we're not passing any parameters.

27
00:01:16,590 --> 00:01:21,860
And this is going to be actually a really easy one, because all we need to do is do take card pass

28
00:01:21,870 --> 00:01:23,520
in the right parameters.

29
00:01:23,850 --> 00:01:29,490
So that's the game player hand because it's the player that's initiating this.

30
00:01:29,880 --> 00:01:35,100
And then game and player cards.

31
00:01:35,430 --> 00:01:38,190
So that's just simply taking the next card.

32
00:01:38,580 --> 00:01:40,920
And this as well can be set to be false.

33
00:01:41,460 --> 00:01:43,680
So same thing that we did when we dealt out the cards.

34
00:01:43,950 --> 00:01:46,290
We're just taking another card from the player.

35
00:01:46,800 --> 00:01:51,310
And we also need to do a check to update the count value.

36
00:01:52,520 --> 00:01:56,250
So to see where the player stands if they've gone over yet.

37
00:01:56,670 --> 00:01:57,630
So see what happens.

38
00:01:57,960 --> 00:02:00,360
So now we should have the hit button functioning.

39
00:02:00,690 --> 00:02:04,210
And it's actually been disabled because we're at twenty one.

40
00:02:04,350 --> 00:02:08,460
So let's try that one more time and keep hitting blackjacks.

41
00:02:08,530 --> 00:02:09,690
Must be my lucky day.

42
00:02:10,050 --> 00:02:11,970
So you got two aces there where you take a hit.

43
00:02:12,450 --> 00:02:17,620
And right now with the hit, we're still at twelve and we're at 22.

44
00:02:17,850 --> 00:02:19,320
So we're over.

45
00:02:19,470 --> 00:02:25,140
So what what should happen now is that we should be disabled to continue playing.

46
00:02:25,500 --> 00:02:28,830
And the hit and the stand should go gray.

47
00:02:29,190 --> 00:02:30,300
And we shouldn't have an option.

48
00:02:30,300 --> 00:02:34,320
We should only have an option for the player or the dealer to play through.

49
00:02:34,800 --> 00:02:37,710
And that's where the final winner gets fired off.

50
00:02:37,980 --> 00:02:41,720
And then this would have to account for playing through with the dealer play.

51
00:02:42,690 --> 00:02:46,800
So let's add the functionality to the other button to the stand button.

52
00:02:47,250 --> 00:02:50,190
And this is if you are happy with the cards that you've got.

53
00:02:50,460 --> 00:02:53,100
You don't want to take any more cards than you do.

54
00:02:53,100 --> 00:02:59,880
The player stand function and the player stand is just going to initiate the dealer play function.

55
00:03:00,630 --> 00:03:03,150
So that means that the dealer is going to play.

56
00:03:03,690 --> 00:03:10,260
And we're going to turn off the two buttons that are providing the options for hit and stand.

57
00:03:10,640 --> 00:03:15,930
So just as we did when we started the game where you are simply playing, turn those two options off

58
00:03:16,560 --> 00:03:19,410
and we'll go deal and stand.

59
00:03:19,770 --> 00:03:21,720
And that should disable the ability.

60
00:03:22,050 --> 00:03:23,960
So it's going to run through the dealer play.

61
00:03:24,390 --> 00:03:29,700
So coming up next, we've got to apply the logic for the dealer play because this is the next step in

62
00:03:29,760 --> 00:03:34,260
the gameplay where the dealer is going to have the ability to play through and.

63
00:03:35,370 --> 00:03:39,570
Till it either reaches 17 or it busts.

64
00:03:39,880 --> 00:03:40,860
That's coming up next.
