The ultimate introduction to Pygame

2,509,245
0
Published 2021-07-11
In this tutorial you will learn to create a runner game in Python with Pygame. The game itself isn't the goal of the video. Instead, I will use the game to go through every crucial aspect of Pygame that you need to know to get started. By the end of the video, you should know all the basics to start basically any 2D game, starting from Pong and ending with the first generation of Doom and Wolfenstein

Link to the project folder: github.com/clear-code-projects/UltimatePygameIntro

Link to the background music: opengameart.org/content/5-chiptunes-action
Link to the artwork: opengameart.org/content/platformer-art-pixel-editi…

Timestamps
0:00:00 intro
0:01:06 How games work
0:05:06 What Pygame does
0:08:08 Creating a blank window (+ clock)
0:22:07 Displaying images (with surfaces)
0:42:22 Basic animations
0:51:28 Rectangles
1:03:47 Collisions with rectangles (+using the mouse)
1:15:38 Drawing with rectangles (+colors)
1:29:35 The player character 1: Keyboard input
1:35:58 The player character 2: Jumping & Gravity
1:44:23 The player character 3: Creating a floor
1:48:17 Creating different game states
1:56:03 Displaying the score (+measuring time)
2:06:15 Transforming surfaces
2:23:50 Better enemy spawn logic (with timers)
2:49:33 Animating the player, the snail and the fly
3:09:01 Using the sprite class (OOP in Pygame)
3:42:57 Adding music

All Comments (21)
  • Seriously you do great job because: + explaining logical parts on seperate screen and then go into implententing + you make a chance to code by yourself + you just use simple drawing on screen to make code and logical parts more understandable + video is split on some smaller parts + tempo is accurate
  • @dennisjeske3629
    I just turned 60, I've been a technologist my entire adult life and have taught many "programming" courses (proprietary languages) for several fortune 100 companies but I'm relatively new to Python. I have to admit my first thought was, this person has a lot of nerve putting out an almost 4 hour video on the subject. I have to admit, when you're good, you're good and you are really good. I did the entire 3:47:57 over the course of 3 days and I got lost one time, init instead of double underscores __init__. That's it. That was the one thing I screwed up, otherwise I learned a ton of new stuff and I'm, really pleased with how it all worked out. In my experience, it's pretty rare in these type of videos for the finished product to look like the author intended but you nailed it. Can't wait to learn more from you. Thanks! All the best, Dennis.
  • @alexc1485
    Love that you release an amazing, 4 hour tutorial like this and it just ends abruptly with, 'so I hope that was helpful' πŸ˜†
  • lost my house to recent hurricane fiona. watching your videos kept me going now im following along to up my pygame skills. by far the best way to get good at python. thank you
  • @Ouvii
    Hahaha, how is it so hard to find programming education like this: the teacher actually spends time explaining concepts instead of explaining lines of code with fruits, colors, and animals while glossing over important material. You are a godsend.
  • @melloirl
    Never before have i experienced such a fun and pleasuring learning experience on any kind of video tutorial ever. I can only thank you for you effort, this is now to me the definition of quality content.
  • I can't believe that you actually uploaded this free for everyone. This is one of the greatest tutorials I've ever seen. Thank you πŸ’œ
  • @grandparick3176
    Your videos literally seems like magic. It's amazing how you go step by step on each process and also give us exercises to try on our own. I hope you keep making more videos and your channel grows exponentially.
  • @mixlaproduction
    The quality of your videos is out of this world CC! Relaxing, valuable and the way you explain things is top notch. I'd like to see a short 2D dungeon-like RPG level game idea with a simple scene changing - that would be a challenge :D P.S. I miss your background tutorial music you used in flappy bird ^^
  • @gabymaymo8482
    46 minutes, I am coding along the video. This is already my new favourite channel of youtube man ! The clarity of speech. The time given for self exercises. This channel is too much !! You are the boss
  • @YeskoGD
    This is honestly one of the best tutorials I've ever watched. You get little exercises every now and then (keeping you from falling asleep) that aren't too easy, but still easy enough to make you feel like you're smart. The video is entertaining but you also learn a lot, and it's very easy to follow. This was the first tutorial that was fun for me to follow along
  • @Jack_______oh
    I'm halfway through and I really appreciate your teaching style. You move quickly but explain everything and why you're doing it. I'm trying to make a top down RPG game so I find it helpful to learn from a tutorial that's doing something different so i have to actually think about the concepts.
  • @thenamesloca
    I started at a more difficult tutorial of yours that I was loving but could not get past an issue I was running into. Starting back from the beginning and solidifying the basics with this video helps so much. From all the videos of yours I've followed I have always loved how clearly you explain these concepts. You make it easy to understand! Thank you for all your videos! I can tell I'm learning especially when there is an urge to clean up the code while working through it, when at one point I didn't even know that was a thing!
  • @OrangeDied
    This is one of the best tutorials I've watched. He explains everything and makes it really easy to visualize how it works, and different ways to use it. This is one of the few long tutorials I've followed to the end, and I enjoyed every second of it. 10/10, would recommend.
  • @therealdyer
    This is absolutely fantastic. So well explained. Slowly but interestingly dealt with and so I feel like I'm actually learning fundamentals and can come back to this on my own at a later date and actually create my own stuff! I'm so happy that this has so many (well deserved) likes and views. Thank you.
  • Thank you for this tutorial. It's the first time I've watched a 4 hour tutorial back to back, and every minute was packed with value. Great job!
  • @dawsonhunt
    Just finished watching and coding along with this video; I have officially created my first video game! πŸŽ‰ Very impressed with your channel, and I look forward to creating more projects from your videos and becoming a better programmer!
  • @masonpeck5252
    This was excellent! I've just jumped into programming in Python and this tutorial is exactly what I was looking for. Kudos and thank you!
  • @flor18gatar
    I can't put into words how much I appreciate you putting out this video, and the pace at which you explain things for beginners like me. Thank you so much. I wish you all the best.