When you're developing a game from scratch.
Look at the flow of the gameplay.
So take it from the player's perspective where they come into the game.
The first action that they want to take is deal.
And, of course, where you are going to look at adding in the bets later on once we get the gameplay
working.
And then the next action that the player has.
They have an option.
They can either hit or stand.
The deal is already grayed out.
So they don't have an option to hit a deal again.
And we already are providing that option to them as stand or take another card.
And that's the two options that the player has.
And while they're still under 21, they can continue to play the game.
So we need to assign some type of action to those clicks.
And we've got the player stand.
So that's looking for a function called player stand.
And we've already created that as a placeholder.
So let's grab those.
We'll move those up.
So these were the previous placeholders that we added.
And so Player Next actually was will account for taking a hit first.
And that's whenever the player needs to take the next card.
They're going to run the function next card.
And we've got a place holder for that.
So we're not passing any parameters.
And this is going to be actually a really easy one, because all we need to do is do take card pass
in the right parameters.
So that's the game player hand because it's the player that's initiating this.
And then game and player cards.
So that's just simply taking the next card.
And this as well can be set to be false.
So same thing that we did when we dealt out the cards.
We're just taking another card from the player.
And we also need to do a check to update the count value.
So to see where the player stands if they've gone over yet.
So see what happens.
So now we should have the hit button functioning.
And it's actually been disabled because we're at twenty one.
So let's try that one more time and keep hitting blackjacks.
Must be my lucky day.
So you got two aces there where you take a hit.
And right now with the hit, we're still at twelve and we're at 22.
So we're over.
So what what should happen now is that we should be disabled to continue playing.
And the hit and the stand should go gray.
And we shouldn't have an option.
We should only have an option for the player or the dealer to play through.
And that's where the final winner gets fired off.
And then this would have to account for playing through with the dealer play.
So let's add the functionality to the other button to the stand button.
And this is if you are happy with the cards that you've got.
You don't want to take any more cards than you do.
The player stand function and the player stand is just going to initiate the dealer play function.
So that means that the dealer is going to play.
And we're going to turn off the two buttons that are providing the options for hit and stand.
So just as we did when we started the game where you are simply playing, turn those two options off
and we'll go deal and stand.
And that should disable the ability.
So it's going to run through the dealer play.
So coming up next, we've got to apply the logic for the dealer play because this is the next step in
the gameplay where the dealer is going to have the ability to play through and.
Till it either reaches 17 or it busts.
That's coming up next.