We've created a way to end the game, but we don't have a great way to restart the game, so we see
that once we we get the restart content, but we're generating a new car.
And there's quite a few things that are happening there that we don't actually need happening within
the page.
And that's because our game area, we're generating a bunch of stuff that's already existing.
So I want to select game area and update the entire HTML and just simply remove out all of the content
that's been available there.
I'm also going to be removing out the height of the gameplay.
As we don't need that anymore, because we actually do want to see the road in the background, so let's
try that out and refresh it.
And when we hit start, let's see what happens.
And now we can hit start again and we're able to start the game once again.
And we can always restart the game because now we're zeroing out what we're building out within the
gameplay.
So we're not adding any extra cars and we're not adding to the confusion of what's happening within
the gameplay.
So we needed to always clear out and reset it back to its initial state.
So just quickly go through that and you can see that we're setting that animation frame.
We're creating the car.
So all of this is being done and it's resetting basically all of the parameters of the game and rebuilding
all of the elements that we're using within the gameplay.
So by clearing it out and sending the inner turmoil to blank, that's essentially clearing everything
out.
And we already have the player content here.
So the players start and player score is already added in there.
So those are the two parameters that we also need to reset in order to create the gameplay.
So now that we've generated that, we can update some of the styling.
And coming up next, we'll do a final run through.
And one of the things that I did say that I want to add in is the ability to generate random colors
for the bad guy cars.
So let's set that up and I'll show you how to do that.
And we go into our functions and we need a way where we're setting it to red.
We need a way to generate a different color for those cars.
So I'll show you how to do that.
And that's just an extra so you don't have to do that.
All of the gameplay is still there, but I'll show you how to do that in the upcoming LESSEM.
That's a quick bonus less instead of red, it'll be random color.