Hi, welcome back.
In this venue, we will complete the game we have started before the Flappy Bird game on.
By adding the end screen and sound system as the following.
We will create the game of service as the following game.
Underscore over underscore sir heckled by a game that image to do between two parentheses ss slash game
of dot bank, then close the parentheses dot convert alpha method three by game dot image the clue then
add it at the middle of our game display by using rectangle method has a following.
So game underscore over underscore rectangle equal game underscore serve dot get on the correct method
between two parentheses of the get under the correct method center equal one hundred forty three and
two handed fifty five to be at the exact center of our game display.
So and its statement which belongs to the game over we add.
Game.
Underscored display that Bennett between two parentheses game underscore over underscore saw, comma,
gave underscore over underscore rectangle and close the parentheses.
OK.
And build our project again and we will get that.
The game over background appears after the game.
Every time the game ends.
OK, the last step to end the sound system to our game using specific by game method called MIXER'S,
which is responsible for both you and sounds and by game using by game, we will head over the first
lines of code of our game or our project as the following to add the mixers or by game that makes our
method the following.
So before the big game, the Tenet method, we add the pygame that makes her not Bre-X underscore it
between two parentheses frequency equals forty four thousand.
And one hundred.
Coma size equals 16, coma channel equals one, coma buffer equals five hundred and twelve, and the
close the parentheses of the body and it may sort of by game, that makes sense.
This is the basis of our Mixu to work perfectly with our sound files, which we add to a folder called
Oju in our working file so we can add the flat sound as a form pleb, underscore sound equal by a game
that makes her sound with as capital between two parentheses and two codes for use slash flapdoodle
way and play it in the statement of the game.
Don't came down.
Then we will copy this line of code of the flat sound and tested.
More four times for the four rest sounds we want to play with the mix of.
Then we will change this for sounds to.
Blues sounds and scoring sounds, we don't need the rest to sound, so we will delete it and let the
first three sounds only, which is more important for our game.
So the flat sound will take the wind, that wave sound and the sound will take the hit, that wave sound
and for the scoring sound will take the point.
That wave sounds OK.
So ends a collision function.
We add the blues underscore sound before the return.
False code line has the following, so we will add it by play it using the delay method as the following
blues underscore sound that delay to parentheses of the play method which are empty parentheses inside
our game loop or zwi loop.
We will add that sound as a side, the message f your statement and the statement inside the loop as
the sole flap underscores, I believe, and to add to empty parentheses of the play, then we will build
our project to check the correctness of our game code as the following.
And we get an error, this error can be solved, it has the following.
We will head over to our mixer, which have the URL.
Which is China should be China's and then again, and the project will work fine without any errors.
OK, but we want to change the size of our sound, our mixer to be 32 instead of 16 and build our Brusic.
Again, I have muted the sound until I will finish set up all the sounds of the game so we can get the
full game experience of the play.
Now I will add Zayla sound, which is the dye sounds as the full.
So they sound equal by game that makes all the sound between two one and to think, of course, produce
less, die that way between two single caught inside the two parentheses then and the sound in the line
after the underscore sound delay method as the following.
So they underscore the delay.
Now we want to add the scoring sounds as well.
So we will create a new variable called scoring timer equal one handed and add it after we define the
scoring sound.
So scoring underscore timer echo one hundred inside the game loop in the if the game on statement we
add scoring underscore Taimur minus equal one.
Then we add an F statement at the following f scoring on the score timer less than or equal zero column.
So the scoring underscore sound of play and scoring sound the timer equal one handed.
So if the scoring time is less than or equal zero time after it's obstructed by one every millisecond.
So the scoring sound will play after the scoring sound played.
We were reset our scoring timer to one hundred a game, OK?
To make this process lubing inside the game loop, OK?
Then we will build our project again after we build our project again, that will work fine with the
game and without any help.
And in the end, by the end of the film and the only problem.
George Mitchell, thanks for being with me and thanks for watching.
See you a bit.