Creating a Flappy Bird Clone in Python / Pygame

A tutorial on creating the popular Flappy Bird game in python with pygame.
If you want to support me: / clearcode
(You also get lots of perks)
Social stuff:
Twitter - / clear_coder
Discord - / discord
Related videos:
Introduction to Pygame: • The ultimate introduct...
Deltatime: • Understanding framerat...
Masks: • Understanding Pygame m...
Timestamps:
00:00:00 - Intro
00:01:00 - Project setup
00:04:27 - Background creation
00:24:59 - Creating the ground
00:32:57 - Creating the plane
00:55:24 - Creating the obstacles
01:16:39 - Score and game over menu
01:37:18 - Adding sounds
Project files:
github.com/clear-code-project...
Pastebin:
main.py (at the start): pastebin.com/CsKbCZFL
main.py (at the end): pastebin.com/Zz745pW6
settings.py: pastebin.com/dGjjEMUP
sprites.py: pastebin.com/vA43b7bS

Пікірлер: 42

  • @ahem1190
    @ahem11902 жыл бұрын

    Another great tutorial! Thanks for all the content, my programming journey is off to a fun start because of your work.

  • @tomkmb4120
    @tomkmb4120 Жыл бұрын

    Great tutorial, thanks so much. It just goes to show how such a 'simple' game seemingly to the user can still require a lot of thought, consideration and planning for what it is.

  • @CodingIsFun
    @CodingIsFun2 жыл бұрын

    This looks great! Thank you for the tutorial! 👍

  • @gawan3390
    @gawan33902 жыл бұрын

    Amazing video as always! Keep the nice work up! :D

  • @pranavxd4606
    @pranavxd46062 жыл бұрын

    Love your videos. Especially your cloning and ursina. Love to see more of ursina though!!!

  • @yourlinuxguy
    @yourlinuxguy10 ай бұрын

    Really Nice, video and clean code.

  • @sonoel97
    @sonoel97Ай бұрын

    Really neat joke there in 7:51, caught me off guard 🤣

  • @mouadhachemi8051
    @mouadhachemi8051 Жыл бұрын

    At 1:05:46 is that a new way of creating timers? or should I still use the method you explained in your Creating timers video?

  • @sudeshmalhotra848
    @sudeshmalhotra8482 жыл бұрын

    Very good tutorial but can you make a video for the road map of python so that I will not be confused while learning it

  • @patrickslomian7423
    @patrickslomian74232 жыл бұрын

    Hi , do you use an website to get the animations , or do you make them yourself ? Can you recommend a website for someone who doesn't want to play with Photoshop for example ?

  • @yourlinuxguy

    @yourlinuxguy

    10 ай бұрын

    Hey pal, did you find any of those websites your talking about?

  • @patrickslomian7423

    @patrickslomian7423

    10 ай бұрын

    @@yourlinuxguy hey, nope :(

  • @sulai2279
    @sulai22792 жыл бұрын

    Hey love your videos! Got a question what's the purpose of the Game class? isn't the same to write that part of the code outside of a class?

  • @centycebra4447

    @centycebra4447

    Жыл бұрын

    then you wont be able to use self. and also it makes the code cleaner and easier to access specific parts like if he wrote the rotate and animate code without classes it would be very complex to store all that code in variable because you cant call just some specific code you need to have a var or class for it hopefully you understand it

  • @lifegoesmon1066
    @lifegoesmon1066 Жыл бұрын

    what codes can i add to create an intro screen?

  • @sakthisivanesh6880
    @sakthisivanesh68802 жыл бұрын

    Pls make vedio on how to convert py files into apk and exe

  • @alphhs5260
    @alphhs52602 жыл бұрын

    Is it different video than the one you had unlisted?

  • @user-sl3qd1os7r
    @user-sl3qd1os7r2 жыл бұрын

    omg thanks

  • @sylvanfranklin6904
    @sylvanfranklin69042 жыл бұрын

    You deserve way more views. Honestly I think pygame is just a very niche topic and it’s hurting your growth (not that I mind, but I want you to succeed)

  • @JoelSantos75
    @JoelSantos752 жыл бұрын

    cool

  • @jampong1562
    @jampong1562 Жыл бұрын

    how to fix no module named pygame??

  • @lashprod9656
    @lashprod96562 жыл бұрын

    what do you use to code?

  • @qqlez

    @qqlez

    2 жыл бұрын

    he uses: language: python with pygame module text editor/IDE: sublime

  • @anantchandak9574
    @anantchandak95742 жыл бұрын

    hey can you just make ursina game engine tutorial like you have done for pygame pls this video is too amazing

  • @qqlez

    @qqlez

    2 жыл бұрын

    he's made 2 ursina tutorials here is the first one: kzread.info/dash/bejne/dnyHtMOPlbTeec4.html

  • @erentu2834
    @erentu28342 жыл бұрын

    why not in Ursina engine :( ?

  • @grafaelzs9726
    @grafaelzs97262 жыл бұрын

    please make a metroidvania game

  • @HarbingerSh
    @HarbingerSh2 жыл бұрын

    you shouldn't multiply gravity by delta twice

  • @thomaspfaff1074
    @thomaspfaff10742 жыл бұрын

    I got an error with the scale factor. full_height = bg_image.get_height () * scale_factor full_width = bg_image.get_width () * scale_factor full_sized_image = pygame.transform.scale (bg_image, (full_width, full_height)) ->TypeError: integer argument expected, got float in line full_sized_image Your github game has also an error. Sorry Game over!

  • @ClearCode

    @ClearCode

    2 жыл бұрын

    I think the issue is that you are running an older version of pygame. If you want to fix it, change the last line to: full_sized_image = pygame.transform.scale (bg_image, (int(full_width), int(full_height)))

  • @thomaspfaff1074

    @thomaspfaff1074

    2 жыл бұрын

    @@ClearCode Yes, really. If updated Pygame and now this problem is over. Thank you. It works

  • @informallogic6388

    @informallogic6388

    2 жыл бұрын

    @@thomaspfaff1074 No dice! I'm getting a similar issue, TypeError: 'float' object cannot be interpreted as an integer I've attempted full_height_int = math.ceil(full_height) full_width_int = math.ceil(full_width) full_sized_image = pygame.transform.scale(bg_image, (int(full_width_int), int(full_height_int))) ValueError: size needs to be (number width, number height) even full_width_int_doubled = (full_width_int * 2) self.image = pygame.Surface(full_width_int_doubled, full_height_int) ValueError: size needs to be (number width, number height) Fully updated pygame via pip

  • @sbinti1152
    @sbinti11522 жыл бұрын

    yoo nice shit ma bui

  • @nicklansbury3166
    @nicklansbury31662 жыл бұрын

    Ninth 😉

  • @sgblitzplayz2027
    @sgblitzplayz20272 жыл бұрын

    Second

  • @amburger1984
    @amburger19842 жыл бұрын

    FIRST

  • @aprameyarayabhari6558
    @aprameyarayabhari65582 жыл бұрын

    third

  • @pirachithbastian2452
    @pirachithbastian2452 Жыл бұрын

    KSI

  • @pirachithbastian2452

    @pirachithbastian2452

    Жыл бұрын

    Pirachith Bastian

  • @atampreethothi3302

    @atampreethothi3302

    Жыл бұрын

    @@pirachithbastian2452 Atampret

  • @user-ds6uz9pl4p
    @user-ds6uz9pl4p Жыл бұрын

    The author, please, I'm from Kazakhstan, I seem to have done everything right, but they say that there are no such game = Game () in the images folder. Can I contact you?