Creating a Flappy Bird Clone in Python / Pygame

  Рет қаралды 55,472

Clear Code

Clear Code

Күн бұрын

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
@ahem1190 2 жыл бұрын
Another great tutorial! Thanks for all the content, my programming journey is off to a fun start because of your work.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
This looks great! Thank you for the tutorial! 👍
@tomkmb4120
@tomkmb4120 2 жыл бұрын
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.
@gawan3390
@gawan3390 2 жыл бұрын
Amazing video as always! Keep the nice work up! :D
@pranavxd4606
@pranavxd4606 2 жыл бұрын
Love your videos. Especially your cloning and ursina. Love to see more of ursina though!!!
@yourlinuxguy
@yourlinuxguy 10 ай бұрын
Really Nice, video and clean code.
@sonoel97
@sonoel97 2 ай бұрын
Really neat joke there in 7:51, caught me off guard 🤣
@sulai2279
@sulai2279 2 жыл бұрын
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 2 жыл бұрын
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
@sudeshmalhotra848
@sudeshmalhotra848 2 жыл бұрын
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
@patrickslomian7423 2 жыл бұрын
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 :(
@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?
@lifegoesmon1066
@lifegoesmon1066 Жыл бұрын
what codes can i add to create an intro screen?
@sakthisivanesh6880
@sakthisivanesh6880 2 жыл бұрын
Pls make vedio on how to convert py files into apk and exe
@alphhs5260
@alphhs5260 2 жыл бұрын
Is it different video than the one you had unlisted?
@user-sl3qd1os7r
@user-sl3qd1os7r 2 жыл бұрын
omg thanks
@lashprod9656
@lashprod9656 2 жыл бұрын
what do you use to code?
@qqlez
@qqlez 2 жыл бұрын
he uses: language: python with pygame module text editor/IDE: sublime
@sylvanfranklin6904
@sylvanfranklin6904 2 жыл бұрын
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)
@anantchandak9574
@anantchandak9574 2 жыл бұрын
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: kzbin.info/www/bejne/enm2g5SMmrarf80
@JoelSantos75
@JoelSantos75 2 жыл бұрын
cool
@jampong1562
@jampong1562 Жыл бұрын
how to fix no module named pygame??
@grafaelzs9726
@grafaelzs9726 2 жыл бұрын
please make a metroidvania game
@erentu2834
@erentu2834 2 жыл бұрын
why not in Ursina engine :( ?
@HarbingerSh
@HarbingerSh 2 жыл бұрын
you shouldn't multiply gravity by delta twice
@thomaspfaff1074
@thomaspfaff1074 2 жыл бұрын
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
@sbinti1152 2 жыл бұрын
yoo nice shit ma bui
@nicklansbury3166
@nicklansbury3166 2 жыл бұрын
Ninth 😉
@amburger1984
@amburger1984 2 жыл бұрын
FIRST
@sgblitzplayz2027
@sgblitzplayz2027 2 жыл бұрын
Second
@aprameyarayabhari6558
@aprameyarayabhari6558 2 жыл бұрын
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?
Can AI code Flappy Bird? Watch ChatGPT try
7:26
candlesan
Рет қаралды 9 МЛН
Learning pygame by creating Snake [python tutorial]
2:05:00
Clear Code
Рет қаралды 341 М.
Can teeth really be exchanged for gifts#joker #shorts
00:45
Untitled Joker
Рет қаралды 13 МЛН
🍕Пиццерия FNAF в реальной жизни #shorts
00:41
Understanding framerate independence and deltatime
29:22
Clear Code
Рет қаралды 38 М.
I Made a Graph of Wikipedia... This Is What I Found
19:44
adumb
Рет қаралды 2,5 МЛН
I run untested, viewer-submitted code on my 500-LED christmas tree.
45:17
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 622 М.
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Coding With Russ
Рет қаралды 843 М.
The rarest move in chess
17:01
Paralogical
Рет қаралды 1,2 МЛН
Learning Pygame by making Pong
28:39
Clear Code
Рет қаралды 203 М.
Training AI to Play Pokemon with Reinforcement Learning
33:53
Peter Whidden
Рет қаралды 6 МЛН
Image Manipulation in Python [ A complete guide to Pillow ]
2:17:18