This lesson we're going to be adding in the score functionality into our game now, we could go into
our TEMEL and add the score in here, but we're going to make this a little bit more interesting where
we're going to add it in using JavaScript.
So we're going to be building out our score area and we can do that where we build the board.
So taking our play area object and we're going to set our score and this is where we're going to be
doing document create element.
So we haven't done this yet where we're going to create an element and then we're going to use it later
on within our JavaScript succeeding span and play area score.
So this is the one that we've just created we haven't placed yet within our HTML yet.
Update the inner HTML of that element.
So let's say press button to start.
So just have some plain text there and play area stats.
So this is the one that we created earlier.
So let's play area status stats and what we did before where we use Append Child and JavaScript to add
in our freshly created element.
And that was the play area score.
So we're adding it into our board.
And now we're going to create another function that's going to update the score, so whenever we click
it and we get a hit that we want to update our score.
So creating an element update score and we can use play area score.
So the one that we just created and take that in our HTML and setting our score to be equal to.
And then we've got our score that we're holding within player score.
And then we also have the lives or the number of misses that just call it lives.
No player and that's items.
So now whenever there's any time within the gameplay that we update the score, such as over here where
we did a hit and we updated our score, we should follow that with the function to update the score.
And also when we build out our board, we should update the score as well, is actually going to sit
and start, which is a better place for it.
So we start game.
We're going to update the score as well.
So we see our score is updating as we click the elements and we achieve scores within the game.
Next, we need to take care of the missus or the lives so that there is a cost to missing it and we
actually have an end to the scheme.
So the objective is that if you miss three of the lives, then the game is over.
So let's set that up.
And that's coming up in the next lesson.
So go ahead and add the score.
And of course, you can go into your HTML and create it and link to it within the JavaScript, as we
did before.
And also it's always a good exercise, practice, exercise to build it out and then make use of it within
your code.
So go ahead and try that out as well.