1 00:00:00,300 --> 00:00:01,500 Hi, welcome back. 2 00:00:01,510 --> 00:00:08,400 In this venue, we will complete the game we have started before the Flappy Bird game on. 3 00:00:09,640 --> 00:00:15,390 By adding the end screen and sound system as the following. 4 00:00:15,640 --> 00:00:20,800 We will create the game of service as the following game. 5 00:00:21,370 --> 00:00:32,320 Underscore over underscore sir heckled by a game that image to do between two parentheses ss slash game 6 00:00:32,320 --> 00:00:43,270 of dot bank, then close the parentheses dot convert alpha method three by game dot image the clue then 7 00:00:43,270 --> 00:00:51,290 add it at the middle of our game display by using rectangle method has a following. 8 00:00:51,460 --> 00:01:02,950 So game underscore over underscore rectangle equal game underscore serve dot get on the correct method 9 00:01:02,950 --> 00:01:12,520 between two parentheses of the get under the correct method center equal one hundred forty three and 10 00:01:12,520 --> 00:01:18,070 two handed fifty five to be at the exact center of our game display. 11 00:01:18,070 --> 00:01:23,620 So and its statement which belongs to the game over we add. 12 00:01:25,050 --> 00:01:25,620 Game. 13 00:01:26,680 --> 00:01:35,110 Underscored display that Bennett between two parentheses game underscore over underscore saw, comma, 14 00:01:35,440 --> 00:01:40,960 gave underscore over underscore rectangle and close the parentheses. 15 00:01:41,230 --> 00:01:41,810 OK. 16 00:01:43,920 --> 00:01:47,790 And build our project again and we will get that. 17 00:01:48,850 --> 00:01:53,530 The game over background appears after the game. 18 00:01:53,710 --> 00:01:55,440 Every time the game ends. 19 00:01:55,580 --> 00:02:04,720 OK, the last step to end the sound system to our game using specific by game method called MIXER'S, 20 00:02:05,470 --> 00:02:15,760 which is responsible for both you and sounds and by game using by game, we will head over the first 21 00:02:16,210 --> 00:02:25,630 lines of code of our game or our project as the following to add the mixers or by game that makes our 22 00:02:25,630 --> 00:02:27,040 method the following. 23 00:02:27,280 --> 00:02:38,050 So before the big game, the Tenet method, we add the pygame that makes her not Bre-X underscore it 24 00:02:38,050 --> 00:02:43,270 between two parentheses frequency equals forty four thousand. 25 00:02:44,170 --> 00:02:45,690 And one hundred. 26 00:02:46,980 --> 00:02:57,390 Coma size equals 16, coma channel equals one, coma buffer equals five hundred and twelve, and the 27 00:02:57,390 --> 00:03:03,370 close the parentheses of the body and it may sort of by game, that makes sense. 28 00:03:03,390 --> 00:03:12,780 This is the basis of our Mixu to work perfectly with our sound files, which we add to a folder called 29 00:03:12,930 --> 00:03:22,830 Oju in our working file so we can add the flat sound as a form pleb, underscore sound equal by a game 30 00:03:22,830 --> 00:03:31,890 that makes her sound with as capital between two parentheses and two codes for use slash flapdoodle 31 00:03:31,920 --> 00:03:36,570 way and play it in the statement of the game. 32 00:03:36,570 --> 00:03:38,580 Don't came down. 33 00:03:39,980 --> 00:03:45,950 Then we will copy this line of code of the flat sound and tested. 34 00:03:47,230 --> 00:03:55,490 More four times for the four rest sounds we want to play with the mix of. 35 00:03:56,950 --> 00:04:00,340 Then we will change this for sounds to. 36 00:04:01,650 --> 00:04:10,320 Blues sounds and scoring sounds, we don't need the rest to sound, so we will delete it and let the 37 00:04:10,320 --> 00:04:16,460 first three sounds only, which is more important for our game. 38 00:04:16,470 --> 00:04:25,380 So the flat sound will take the wind, that wave sound and the sound will take the hit, that wave sound 39 00:04:25,710 --> 00:04:30,930 and for the scoring sound will take the point. 40 00:04:30,930 --> 00:04:32,850 That wave sounds OK. 41 00:04:33,390 --> 00:04:35,910 So ends a collision function. 42 00:04:35,910 --> 00:04:40,410 We add the blues underscore sound before the return. 43 00:04:40,410 --> 00:04:53,220 False code line has the following, so we will add it by play it using the delay method as the following 44 00:04:53,760 --> 00:05:03,870 blues underscore sound that delay to parentheses of the play method which are empty parentheses inside 45 00:05:03,870 --> 00:05:06,180 our game loop or zwi loop. 46 00:05:07,090 --> 00:05:18,540 We will add that sound as a side, the message f your statement and the statement inside the loop as 47 00:05:18,540 --> 00:05:26,800 the sole flap underscores, I believe, and to add to empty parentheses of the play, then we will build 48 00:05:26,800 --> 00:05:31,750 our project to check the correctness of our game code as the following. 49 00:05:34,130 --> 00:05:39,540 And we get an error, this error can be solved, it has the following. 50 00:05:39,740 --> 00:05:43,700 We will head over to our mixer, which have the URL. 51 00:05:44,910 --> 00:05:53,470 Which is China should be China's and then again, and the project will work fine without any errors. 52 00:05:54,010 --> 00:06:04,840 OK, but we want to change the size of our sound, our mixer to be 32 instead of 16 and build our Brusic. 53 00:06:04,860 --> 00:06:15,360 Again, I have muted the sound until I will finish set up all the sounds of the game so we can get the 54 00:06:15,360 --> 00:06:18,330 full game experience of the play. 55 00:06:18,560 --> 00:06:24,800 Now I will add Zayla sound, which is the dye sounds as the full. 56 00:06:26,010 --> 00:06:33,430 So they sound equal by game that makes all the sound between two one and to think, of course, produce 57 00:06:33,450 --> 00:06:43,500 less, die that way between two single caught inside the two parentheses then and the sound in the line 58 00:06:43,500 --> 00:06:48,370 after the underscore sound delay method as the following. 59 00:06:48,570 --> 00:06:52,170 So they underscore the delay. 60 00:06:52,170 --> 00:06:56,750 Now we want to add the scoring sounds as well. 61 00:06:57,150 --> 00:07:06,870 So we will create a new variable called scoring timer equal one handed and add it after we define the 62 00:07:06,870 --> 00:07:07,740 scoring sound. 63 00:07:08,190 --> 00:07:19,170 So scoring underscore timer echo one hundred inside the game loop in the if the game on statement we 64 00:07:19,320 --> 00:07:25,590 add scoring underscore Taimur minus equal one. 65 00:07:25,830 --> 00:07:36,150 Then we add an F statement at the following f scoring on the score timer less than or equal zero column. 66 00:07:36,690 --> 00:07:46,040 So the scoring underscore sound of play and scoring sound the timer equal one handed. 67 00:07:46,320 --> 00:07:57,300 So if the scoring time is less than or equal zero time after it's obstructed by one every millisecond. 68 00:07:57,660 --> 00:08:03,560 So the scoring sound will play after the scoring sound played. 69 00:08:04,570 --> 00:08:10,410 We were reset our scoring timer to one hundred a game, OK? 70 00:08:11,400 --> 00:08:15,770 To make this process lubing inside the game loop, OK? 71 00:08:16,980 --> 00:08:26,100 Then we will build our project again after we build our project again, that will work fine with the 72 00:08:26,100 --> 00:08:30,570 game and without any help. 73 00:08:31,050 --> 00:08:38,930 And in the end, by the end of the film and the only problem. 74 00:08:38,940 --> 00:08:43,800 George Mitchell, thanks for being with me and thanks for watching. 75 00:08:44,070 --> 00:08:45,690 See you a bit.