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

preview_player
Показать описание
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!!
Рекомендации по теме
Комментарии
Автор

Thank you for all your content. I appreciate that you break the coding down to understand what we are trying to accomplish.

positiveEnergyProgramming
Автор

Das the good stuff, this channel is the GOAT

Eysh
Автор

I don't know what to comment but i want to comment

kartiknagrale
Автор

YES! I cant wait to code this, thanks!

KellenBegin
Автор

Finished it in two sittings.
This one went way smoother(as in much easier coding along) than the PacMan, at least for me.
Would definitely recommend.😎

flioink
Автор

Guess I'm becomming a pygame expert now😄
Difinitely on my "to do" list and this one looks much more manageable.

flioink
Автор

Hi friend, I'm Brazilian and a big fan of python and yours works, I found your channel recently, I made the "Adventure Capitalist" thanks to one of your videos, I really appreciate everything I learned in that one hour video and I' m grateful for your work. I would like to know if you could create a video even if simple recreating the game "Idle Mine: Remix" I'm an admirer of idle games HEHE...

jovinull
Автор

How do I install all your assets and put them in my pygame folder

kristinmartin
welcome to shbcf.ru