Learning Python in 2 Days – Pygame Community Jam

///Learning Python in 2 Days – Pygame Community Jam

Learning Python in 2 Days – Pygame Community Jam

FavoriteLoadingAdd to favorites

I tried to learn Python by making a game with the Pygame graphics library for the Pygame Community New Years Jam. In 2 days, I was able to put together a simple game (Flappy Bird meets Cookie Clicker?), and I learned a lot along the way!

Check out Flappuccino here:
→ Source Code:

Best Height Adjustable Desk Under $300 ($15 discount):

→ Twitter:
→ Twitch:
→ Join the PolySpace Discord:


0:00 Intro
0:41 Setting Up Python
1:20 Streaming?
1:29 Game Idea
2:25 Implementing Basic Gameplay
3:15 Adding Sprites
4:06 Collectible System
5:18 Basic UI
6:01 Upgrade System
7:42 Fancy Background
8:09 Finishing Touches
8:47 Conclusion


“Nocturnal” – PolarChips (
“Swing” – PolarChips (
“Glider” – INTL CMD (
“Breeze” – PolarChips (
“EDM Detection Mode” – Kevin Macleod (
“Sneaky Snitch” – Kevin Macleod (
“Operatic 3” – Vibe Mountain (

—If you liked this video, here are similar ones you might enjoy!—

PolyMars – Learning SDL2 in 48 Hours – GMTK Game Jam 2020

PolyMars – Making a Game Using Discord’s Bot API

CodyCantEatThis – I Made Super Mario Bros but it’s 3D

Dani – He said I Couldn’t Make a 3D Game… So I Made One!

Dani – 6 Months of Learning Game Development in Unity (Progress & Result)
Sam Hogan – I Made a Game with Intentional Bugs

Sam Hogan – I Made the Hardest Game Ever

Mythic Legion – Remaking My First Game! | Devlog #1

Randall – Programming a New Physics Engine for my Game

—Descriptive Description—

I thought it would be fun to try to learn Python by challenging myself to create a video game in under 48 hours (2 days) using the Pygame graphics library. Yes, I know Python probably isn’t the best language for making a real-time game, but it’s definitely fast enough for my simple 2D games, like the one I created with SDL2 in 48 hours for the 2020 GMTK Game Jam.

For this devlog challenge, I found a week-long game jam: the PyGame Community New Years Jam, but I decided to shorten it to 2 days and give myself only 48 hours to make a game.

First things first, I had to set everything up, which actually ended up being pretty easy. I ran the Python installer for Windows, added the Python extension to VS Code, and installed Pygame through pip. Now we can get into the actual game-making! I decided to try to make a game similar to Flappy Bird, but vertical—you would collect coffee beans to upgrade stats like flap strength and speed in order to fly as high as possible.

I found a Pygame example that showed me how to draw a square to the screen. Next was gravity, which is very simple for a game like this. Every frame, I add a fixed value to a y velocity variable, then I add the y velocity to a y position variable, and I draw the square at that y position. Then, I figured out how keyboard input worked in Pygame, and made it so when you press a key, the velocity variable is set to a negative fixed amount, allowing the blue square to flap. I also gave the player an x velocity that flips if its x position is less than 0 or greater than the screen width. Now the core mechanic of the game is done—you can flap and bounce off the walls.

I created graphics for the player and coffee bean collectibles, and created a “camera” that follows the player—basically I just offset everything on the screen by the player’s y position. For the coffee bean functionality, I made a Collectible class with Vector2 to store its position, and wrote a function for rectangle collisions. I draw a list of beans above the player, and if any bean collides with the player I reset its position to a random range above the player. And with that, the main game is finished.

I finished off the project by adding UI and other visuals, like a colorful background, and creating a shop (using bean currency) with three upgrades—one that increases your flap strength, one that makes you faster, and one that makes more coffee bean collectibles spawn. And that’s where the challenge ended! This was learning Python in 48 hours with Pygame.


By |2021-04-29T13:46:25+00:00April 29th, 2021|Python Video Tutorials|22 Comments


  1. PolyMars April 29, 2021 at 1:46 pm - Reply

    this video totally didn't take 2 months to make

  2. Gabriel Mourão April 29, 2021 at 1:46 pm - Reply

    5:30 polymars gaming setup

  3. Blober 8000 April 29, 2021 at 1:46 pm - Reply

    Idk why people hate on scratch so much without it I would never have learned coding

  4. Sandeeep Kiran April 29, 2021 at 1:46 pm - Reply

    I started python last week.
    I learnt hello world.

    Idk anything else now

  5. NerdTheBox April 29, 2021 at 1:46 pm - Reply

    good video, but I'm disliking because you insulted scratch at 0:14, terribly sorry, hope you understand

  6. Burak Sever April 29, 2021 at 1:46 pm - Reply

    Which program did you use to make sprites?

  7. teakid April 29, 2021 at 1:46 pm - Reply

    Hehe the name of the game though

  8. Mighty Zain April 29, 2021 at 1:46 pm - Reply

    well i code and i have a suggestion you should add a bean variable that you can change and when you are lazy you woudnt have to collect just change the variable and add a function def
    its simple = add a class and list it in it then just do self.beans = amount_beans
    beans = (100, 90, 10)

    1. amount of beans
    3.jump boost
    maybe it wont work cause you have already crated a variable

  9. Gabriel Corral April 29, 2021 at 1:46 pm - Reply

    Wow that was really cool

  10. Dutch sin más April 29, 2021 at 1:46 pm - Reply

    "I might be terrible at coding, but at least I'm transparent about it"

    Literally me

  11. updownbanana April 29, 2021 at 1:46 pm - Reply

    "can someone post in chat how to declare a variable" laughs in python programmer

  12. Aya Oker April 29, 2021 at 1:46 pm - Reply

    0:57 Badass music making you think he will do something epic

    Reality : p r i n t ( " h e l l o w o r l d " )

    my first program 😀

  13. Prototype-mk 47 April 29, 2021 at 1:46 pm - Reply

    inpressed by the drawings haha

  14. Guilherme April 29, 2021 at 1:46 pm - Reply

    pythom is so easy, at least for me. Its like c++ but with more commodity, and lua its shitier(good language but very annoying)

  15. Gotin April 29, 2021 at 1:46 pm - Reply

    Add this game to Google play

  16. Isaac e Lucas YT April 29, 2021 at 1:46 pm - Reply

    plz make this game to android

  17. Kees vdB April 29, 2021 at 1:46 pm - Reply

    python is fun

  18. Zevcraft April 29, 2021 at 1:46 pm - Reply

    Just wondering when did you start learning to code? (I just started learning java a few days ago)

  19. SoulSpirit April 29, 2021 at 1:46 pm - Reply

    Every single kid wants to become python programmist. fuck that

  20. Brady Redding April 29, 2021 at 1:46 pm - Reply

    What do you use to edit your videos? They look great!

  21. Peter K. April 29, 2021 at 1:46 pm - Reply

    You kind of look like Polygon Donut in a way

  22. lunatic_ cultist April 29, 2021 at 1:46 pm - Reply

    trojan ??? my antivirus said so lol

Leave A Comment