filmov
tv
How to Make a Duck Hunt Game in Python with PyGame!

Показать описание
Link to all code and assets available for download here:
Consider becoming a super supporter of the channel at my Patreon:
This project was inspired by the classic carnival/arcade style shooting gallery games! Today we build the entire project from scratch using python and the PyGame framework. We start by setting up PyGame, and drawing static images on the screen. Then we animate tiers of procedurally drawn enemies onto each level and get them moving, then check to see if the player has shot them. Once the player clears a full level of enemies, they proceed to the next level. Then we create pause functionality, a main menu and game over conditions.
We store the high scores in an external text file that we read in from when the game boots up and write to it any time there is a new high score during gameplay.
This project was a lot of work and a ton of fun to build! If you need a full PyGame introduction series check out my playlist here:
And if you want to see other full game builds in python with PyGame check some of these out!
Don't forget to leave a like, subscribe to the channel and let me know in the comments what you thought of the video and what you want to see more of in the future!
TIMESTAMPS:
00:00:00 Intro and Project Showcase
00:02:53 Setting Up Pygame And Importing Images
00:13:28 Drawing the Gun and Rotating With Mouse Position
00:26:30 Drawing Enemies Onto the Screen
00:37:59 Procedurally Generate Enemy Starting Coordinates
00:51:17 Make Enemies Move With Speed Based on Tiers
00:58:35 Check for Mouse Collision with Targets on Shots
01:13:42 Display Score, Mode Status, Time Elapsed and Total Shots!
01:22:07 Menu Control and Setup
01:45:00 Pause Menu and Restarting from the Game Screens
01:52:00 Re-Initializing Enemy Coordinates on Restart
01:59:20 Game Over Conditions!
02:10:50 Reading and Writing to a .txt Text file for high scores!
02:15:23 Adding Background Music and Sound Effects!
02:20:30 Outro and Thank you!!
Consider becoming a super supporter of the channel at my Patreon:
This project was inspired by the classic carnival/arcade style shooting gallery games! Today we build the entire project from scratch using python and the PyGame framework. We start by setting up PyGame, and drawing static images on the screen. Then we animate tiers of procedurally drawn enemies onto each level and get them moving, then check to see if the player has shot them. Once the player clears a full level of enemies, they proceed to the next level. Then we create pause functionality, a main menu and game over conditions.
We store the high scores in an external text file that we read in from when the game boots up and write to it any time there is a new high score during gameplay.
This project was a lot of work and a ton of fun to build! If you need a full PyGame introduction series check out my playlist here:
And if you want to see other full game builds in python with PyGame check some of these out!
Don't forget to leave a like, subscribe to the channel and let me know in the comments what you thought of the video and what you want to see more of in the future!
TIMESTAMPS:
00:00:00 Intro and Project Showcase
00:02:53 Setting Up Pygame And Importing Images
00:13:28 Drawing the Gun and Rotating With Mouse Position
00:26:30 Drawing Enemies Onto the Screen
00:37:59 Procedurally Generate Enemy Starting Coordinates
00:51:17 Make Enemies Move With Speed Based on Tiers
00:58:35 Check for Mouse Collision with Targets on Shots
01:13:42 Display Score, Mode Status, Time Elapsed and Total Shots!
01:22:07 Menu Control and Setup
01:45:00 Pause Menu and Restarting from the Game Screens
01:52:00 Re-Initializing Enemy Coordinates on Restart
01:59:20 Game Over Conditions!
02:10:50 Reading and Writing to a .txt Text file for high scores!
02:15:23 Adding Background Music and Sound Effects!
02:20:30 Outro and Thank you!!
Комментарии