honestly, its these small coding channels that provide the most useful information, especially to self learning coders like me. Props to u!
@NavjotSingh-zx3we4 жыл бұрын
i am with yo
@A6h4v3 жыл бұрын
@@NavjotSingh-zx3we reply to a reply
@A6h4v3 жыл бұрын
GELOMILF
@ifergff22803 жыл бұрын
U are not alone, we all are here👍👍
@mimic_ed6 ай бұрын
It's not small anymore🎉
@michaelshuvalov91004 жыл бұрын
Amazing clarity, someone who clearly not only knows how to execute the code, but has a thorough understanding in it. "If you can't explain it simply, you don't understand it well enough." - Mr Einstein
@ClearCode4 жыл бұрын
Thank you!
@thepaulcraft9573 жыл бұрын
Mr Einstein's words in German "Wenn du es nicht simpel erklären kannst, hast du es nicht gut genug verstanden."
@kaneki_ken_073 жыл бұрын
@@thepaulcraft957 Thats because Einstien's German, Yeah..!!
@yuka82863 жыл бұрын
@@kaneki_ken_07 Einstein's dying wish was to be referred to as "A rock", other than "The rock" as we all know as Dwayne "The Rock" Johnson, "A rock" in German is "Ein Stein". A singular rock can make a difference, we should respect that.
@kaneki_ken_073 жыл бұрын
@@yuka8286 Well, there was some other conversation going on and I see some comments are deleted. So, I think you didn't understand the topic because of deleted comments.
@Tila14 жыл бұрын
0:18 Installing Pygame 0:51 How Pygame works 5:37 Drawing 13:26 Animations 20:24 Input 24:27 Opponent 'AI' 25:47 Basic Scoring
@muhammadanas76983 жыл бұрын
Thanks
@TN3.1 Жыл бұрын
That was really helpful. I knew how to make basics but i mainly needed to learn animation and opponent AI. Thank you very much!
@micahcarter13324 жыл бұрын
You’ve done better explaining PyGame than the 90% of PyGame tutorials I’ve watched.
@itsspratham8023 жыл бұрын
yes,tech with tim and other coding channels were tooooo hard and explained complicated,i almost felt like quitting game devolopment but luckily in time i found clear code
@pathikghugare99183 жыл бұрын
Yeah man really
@Harry-ub2fv4 жыл бұрын
To be honest, I've read the book 'Beginning Game Development with Python and Pygame (2007)', but this man accurately and more clearly explained all of that in just 4 videos that too in a concise manner. Thanks a lot. You are awesome.man()
@enderman-minecraftmonsters82492 жыл бұрын
the function at the end really completed it lol
@quasarcore4 жыл бұрын
One of the best programming videos I've seen, super clear and concise explanations
@yusufnusrat4 жыл бұрын
i am just 2 mins in and so many information that nobody would say that. thanks a lot this really helped me. never know why small channels are always most helpful
@shantanubindhani16224 жыл бұрын
Your Chanel deserves to grow!.... You content is so awesome to understand, it has good clarity, you make the learning seems easy.. Greatly looking forward for new uploads
@abrarmasumabir38093 жыл бұрын
This guy is so clear...he definitely deserves million of subscribers
@akshhat974 жыл бұрын
This was so crisp and clear. I've seen other tutorials where they just guide you through the code without explaining the underlying concepts but this was definitely what I needed. Thanks!
@lousimms47664 жыл бұрын
I hope you make more videos, was struggling with pygame trying stuff on my own just reading the documentation but was sooo off with rect collisions, this explained it perfectly!
@ClearCode4 жыл бұрын
Thank you, glad it helped :) check out my channel, I already made lots more pygame tutorials
@rebornreaper1944 жыл бұрын
Your presentation style is incredibly intuitive, tysm :D
@diegocruz81874 жыл бұрын
I've been watching your tutorials for a while and you are simply amazing!! Really, you can't imagine how helpful your channel has been for me.
@elib79114 жыл бұрын
Thanks so much man, I'm a 3rd-year student in college learning computer science. I am very interested in game development/coding and this helped a lot. Hope you make more :)
@rajab41874 жыл бұрын
I'm in 2nd year I'm into web development (front. End) N PyGame too Hope will go any of these twos route Before I mess up in ma mind
@shourya99984 жыл бұрын
Best tutorial video I've ever seen! Hats off to this guy
@alooooshm4 жыл бұрын
you truly live up to your channel name. clear coding indeed! honestly, if I could give you more than one like I would. please keep it up and if you could cover some AI topics and applications that would be amazing
@bepositive271 Жыл бұрын
For you kind information this is the first video of The world greatest coding teacher like the editing , voice , and the way of explaining is just perfect even in his first video I just want to say that he is a "Legend"
@adrienlenud3 жыл бұрын
Thank you so much, you explain things so simply and intuitively compared to the other ressources I was trying to use
@yassinezanned98373 жыл бұрын
Astonishing simplicity and amazing content from your part, sir. Thanks really much.
@knightmare62494 жыл бұрын
Actually an amazing tutorial, I'm amazed by how you were able to explain the code line by line. Thank you.
@knightmare62494 жыл бұрын
btw who are the six people that disliked this lol
@knull85084 жыл бұрын
your explanation is so clear this is amazing !
@paradoxicalinsomniac99504 жыл бұрын
this is the best python tutorial i've ever seen in my life
@rajab41874 жыл бұрын
It's PyGame
@xadas52304 жыл бұрын
I just had the urge to write this comment, and compliment you for doing those type of videos, as a beginner/intermediate programmer this really helps me to understand pygame better. Thanks for your work, looking forward to more videos of yours.
@dolphinman98022 жыл бұрын
Awesome video! You walked through it all really well and it was easy to follow along to. One change i made to the code though, that made the AI smarter, is i changed the opponent_ai function to compare the opponent center y with the ball instead of opponent bottom and opponent top respectively. This made it so the opponent tried to align its middle with the ball instead of its bottom/top. def opponent_ai(): if opponent.centery < ball.y: opponent.centery += opponent_speed if opponent.centery > ball.y: opponent.centery -= opponent_speed if opponent.top = screen_height: opponent.bottom = screen_height
@Schachlover4 жыл бұрын
Best explained tutorial ever. U R really a gifted teacher. Wish I had found something similar when I started. Please keep up the good work. Best wishes from D. R.
@ClearCode4 жыл бұрын
Thank you so much 🙂
@Schachlover4 жыл бұрын
Could you please make a tutorial on string manipulation ; let's say, moving text on the screen using Python or better pygame? Thanks in advance.
@AC-he8ln2 жыл бұрын
I think these Pong videos are the best starting Pygame starting series on KZbin. The others are also good but too complex for a first project.
@yashshreeaute81083 жыл бұрын
This is the best channel I ever seen for self learners. keep it up Man!
@todd35784 жыл бұрын
This video is amazing, you really know how to explain the code!
@ismailaminu98264 жыл бұрын
Do you know what software he was using?
@aidan50774 жыл бұрын
Just made this after watching your flappy bird video. These tutorials are incredible
@chigstardan72854 жыл бұрын
This is one of the best tutorials ive ever seen and the clarity is.... Muah. Keep up the good work
@mier72394 жыл бұрын
Thank you very much for the tutorial - its very well explained - just a pointer on a little twitch in the game: the ball can get behind the 'players' and move weirdly alongside it until it gets out.
@ClearCode4 жыл бұрын
Yes, that's true. Although it is only really a problem as long as the ball can bounce on the left and right side of the screen. Once that is removed and the ball just gets reset there it should be fine.
@jivinhipcat4 жыл бұрын
I noticed the same thing. I think the ball can collide with the top and bottom surfaces of the player/opponent rect. It then changes the x direction but not the y, so it is still colliding with the same surface during the next move. It keeps changing the x direction this way until it works it's way all the way up/down the player/opponent rect. I tried adding this if-else statement to the collision detection and I think it fixes it. It's such a small amount of movement that you don't notice it, and it makes the ball begin from the infacing side of the player/opponent so the problem collision no longer happens. if ball.colliderect(player) or ball.colliderect(opponent): ball_speed_x *= -1 if ball_speed_x > 0: ball.x = 30 else: ball.x = screen_width - (ball_width + 30) *I think I have adjust the player/opponent paddle sizes to make them a little wider. I don't remember just now what they were originally.
@ClearCode4 жыл бұрын
@@jivinhipcat Now I get it, that is indeed a bit of a bug. And your solution is workable but I would say that it doesn't achieve the right goal. Basically, when the ball hits either the top or bottom of the paddle, the player (or opponent) shouldn't be able to recover the ball anymore. A really quick solution would be to change the parameters when ball_start is called from 0 and screen_width to 15 and screen_width - 15. That way the ball starts when it is even a pixel beyond the paddle; and that removes the issue quite drastically. Doesn't look very good though. Another way would be to modify your approach to move the ball to the opposite direction that you send it; and that would trigger the the ball_start function on the next cycle of the while loop. But I don't think it would look good either since the ball would just disappear mid-air (kinda like the approach above). I think the best way to fix this issue would be to properly code a collision for the top and bottom of the paddles, so that we get a proper movement for it. I am planning on making more pygame tutorials anyway, I'll make a video how to fix it next week :)
@ClearCode4 жыл бұрын
@@jivinhipcat Here is a good stack overflow answer that explains how to get collisions for different sides: stackoverflow.com/questions/20180594/pygame-collision-by-sides-of-sprite
@jivinhipcat4 жыл бұрын
Clear Code nice. I didn’t even think that top/bottom contact should be considered bad, and that makes total sense. I’m just starting with code, and I really like the style of your videos. I’m still playing with this Pong game turning it into an abomination with sounds and images. I plan on watching all your videos as I go. Thanks for making them.
@semajislove23534 жыл бұрын
My first Python project, thank you very much, Good Sir!
@ClearCode4 жыл бұрын
You're welcome and glad you liked it :) I made lots more pygame tutorials and I will make a video on a much better pong game in about a week!
@spaidory8742 жыл бұрын
Thanks bro. Your vids are cool and rly well edited. U are underrated.
@synthoelectro4 жыл бұрын
This guy has a personality, that's a good thing.
@jivinhipcat4 жыл бұрын
I wish all videos were this good. Thanks for it man.
@Oxim1nus2 жыл бұрын
Really helpful and very well explained, i did this and some of your other tutorial-projects and it's a great way to learn, please keep going with the great job
@TypeZ3R04 жыл бұрын
BEST EVER EXPLANATION FOR PROGRAMMING. PLZ MAKE VIDEOS ON PYTHON MACHINE LEARNING, DEEPLEARNING AND COMPUTER VISION WITH PYTHON🙏🏽🙏🏽
@bearwater87473 ай бұрын
Just finished this video thank you for helping me learn, I am still a little confused but I am using you to teach myself.
@gamedog123games Жыл бұрын
I've been trying to make a game without an engine (yet my brain stops working when I open VSCode) and this was a lifesaver and helped me start out with a small project
@Zellaaaaaaaaaaa2 жыл бұрын
Very informative and instructive tutorial! Thank you
@structuralcraft2 жыл бұрын
Your teaching outline is good to begin with
@didyouknowsciences5 жыл бұрын
Thanks for the tutorial as well as the clear and detailled explanations.
@ClearCode5 жыл бұрын
Glad you liked it, let me know if you want me to cover another Pygame topic
@AmateurStoryteller4 жыл бұрын
Clean and CLEAR beginner tutorial... as the channel name
@davependrell66534 жыл бұрын
Awesome tutorial video. Your transitions and animations are super nice as well.
@parthgupta48504 жыл бұрын
you are greAt ! a wonderful experience thanks a lot a different from all the other videos (a straight to the point video with clear concepts) really thanku *now I got to know what power does coding has*
@imherovirat3 жыл бұрын
Subscribed, awesome, perfect,wonderful and really understandable, Thank you Clear Code for this amazing Content.
@mitchellfolbe87294 жыл бұрын
Good exercise with good explanation. Thank you.
@qashrina44024 жыл бұрын
Your explanations are so clear!! Thank you so much.
@christianschaub1602 жыл бұрын
Amazing tutorial. Thank u for all the explanation step by step guy 😃💪
@sudiptobusiness15033 жыл бұрын
Your explanation is so clear..
@mohammedsaad38013 жыл бұрын
yup dude u explaain well which is why I also bought ur udemy classes I saw u on it and thanks for the great content
@ktzplayz26014 жыл бұрын
Amazing graphics and a thorough and great tutorial = fast sub :)
@0x656e4 жыл бұрын
That was a really great video thank you very much for making this great video.
@DailyFacts698 Жыл бұрын
I don't know what python was like 3 years ago, but now I was able to make player moving by this lines: keys = pygame.key.get_pressed() ''''if key[pygame.K_UP: ''''''''self.player.x += 7 and this works even when you hold the button :)
@sultanrasul27943 жыл бұрын
Why do you not have 1+ million subs, people get this man too 1mil
@hürriyetpalestine9 ай бұрын
great explanation...hate other tutorials that just try to have you copy their code without explanation
@muradpetrosyan51284 жыл бұрын
The best tutorial for PyGame
@hariharanm67054 жыл бұрын
No words to appreciate Clear Code. Is this a teamwork or all are done by yourself?
@ClearCode4 жыл бұрын
hey, yes I am making it by myself (looks much harder than it actually is tbh)
@polyeder20003 жыл бұрын
To solve the problem with keydown: Use keys = pygame.key.get_pressed() if keys[pygame.K_w]: This way the player will move as long as the key (w in this case) is held down. Do this after checking for events (and don't check the movement keys in the events section.)
@jefhamish2 жыл бұрын
With this method, my player's speed seems inconsistent and/or slower than it should be as if for some frames it's missing that the button is held down.
@gdd98662 жыл бұрын
Amazing and well explained.
@abhalera4 жыл бұрын
Very nicely explained. Thanks
@rezashir3873 Жыл бұрын
actually im zero in programing. i like to become hero in programing, like you. thank you
@freadbear9645 Жыл бұрын
This was the first game I learned to make from scratch
@pcslowhand4 жыл бұрын
Thanks very much for this video. It was really helpful :)
@thelife88362 жыл бұрын
You are the best brother❤
@jurkokubik63834 жыл бұрын
this was a really good tutorial!
@riya6549 Жыл бұрын
can someone explain to me why we needed to increment player _speed at every loop when the key is pressed down instead of directly incrementing the y coordinates of player when the same happens?
@heysiri_official Жыл бұрын
He explain it at 21:25
@riya6549 Жыл бұрын
@@heysiri_official yeah, i know he mentioned it...but i still couldn't get why exactly. A little expansion would help
@kaberanshutisamuel1856 Жыл бұрын
how I learned this is hilarious, I first followed along tutorial and then the nextday i tried to do it without tutorial and comeback for where I am stuck, the funny thing I am very understanding it for the second time
@swiftal83124 жыл бұрын
Your the best, i watched someone else and he made my pygame so it looked blocky and 30 fps. But with your vid its smooooooooth
@stefanleustean42534 жыл бұрын
Really good tutorial!!
@magoninhogamer4 жыл бұрын
finally a good pygame tutorial
@ClearCode4 жыл бұрын
Thanks, I actually made quite a few by now :)
@magoninhogamer4 жыл бұрын
@@ClearCode awesome! you deserve more attention :D
@KeremDemirtas3 жыл бұрын
Thanks for the tutorial. I just don't get one simple part. Why don't we need to declare player_speed as a global inside the player_animation finction but we need to declare ball_speed_x and ball_speed_y variables as globals inside the ball_animation function?
@lucasreingo4 жыл бұрын
Thanks so much for this pog tutorial. Also if you want to make the AI a bit better in the opponent_ai function instead of opponent.top < ball.y:, you can use opponent.centery. This is more efficient as it checks if the ball is lower or higher than the center of the opponent Rect.
@IGOverkill3 жыл бұрын
thanks it really made the program better but you also need to replace ' opponent.bottom ' with 'opponent.centerx'
@lucasreingo3 жыл бұрын
@@IGOverkill yh, soz I forgot that. Good luck on your pygame journey
@joeyh21853 жыл бұрын
very well made and helpful :) cheers mate
@akiha76114 жыл бұрын
thank you very much for the tutorial, you teach very well bro
@ChaosArtist3 жыл бұрын
Thanks for this tutorial, very helpful.
@iohellemans32802 жыл бұрын
great tutorial, loved it
@duckperson55333 жыл бұрын
0:49 For me it says: No module named pygame, even after installing it again.
@leobozkir54254 жыл бұрын
19:38... But... We did not create that variable in a function right? I don't understand... I thought that we just made it when the code ran... SOMEONE PLEASE EXPLAIN?
@ClearCode4 жыл бұрын
yeah, we did. Whenever you assign a value to a variable name (can be + or something like += ) you create a new variable.
@munjolla4 жыл бұрын
Great tutorial!
@silverseacow2 жыл бұрын
18:46 Like cant we also add arguments, ballxspeed and ballyspeed for the function ball_animation() instead of global variables
@kogulansaravanabawan20342 жыл бұрын
Very use full sir! And please tell me how to create this game for mobile phones!
@TheCaliKing244 жыл бұрын
I need help! i copied the code word for word up until the 13:21 mark of the video, but when i try to run it in pycharm all i get is an open window with the title of the window, but no pictures or drawings just a blank window. ive tried other tutorials and also dont get the drawings to pop out in the window when i run my program can anyone help me? ive tried reinstalling pycharm twice but to be honest i think that pygame is the real problem
@ClearCode4 жыл бұрын
Hey, I uploaded the code for the game, can you try to run that and see if it works? But besides that it's hard to help because I'd need to see the code.
@TheCaliKing244 жыл бұрын
@@ClearCode hey bro i appreciate the reply, however I already got it working, the issue was that my pygame module wasnt working properly because on my project interpreter i was using an old version of pygame as well as an old version of pip and it wasnt letting me update them until just yesterday it finally updated and is working 100% properly. thanks anyways my friend
@ClearCode4 жыл бұрын
@@TheCaliKing24 I know that pain. I have an ancient MacBook Air with preinstalled Python 2 and had to build a custom system for sublime to run code properly... that was incredibly annoying
@dungngoquang835411 ай бұрын
very useful, thank you so much!!!!
@erremazo3 жыл бұрын
Excelent video, thanks a lot.
@conorhogan61113 жыл бұрын
Why does ball_speed_x and ball_speed_y have to be included as global variables in ball_animation, but player_speed not have to be included in player_movement?
@kodaditank173 Жыл бұрын
thank you u saved my life
@saadedi752 жыл бұрын
thanks for all video
@Mayank-hm7cc4 жыл бұрын
plz can you help me...sometimes when the ball collides with the top of rects it get dragged along I did all the steps you mentioned
@eeeehhvgvgf4 жыл бұрын
oh thats a bug even i noticed it
@kostaskoukos39323 жыл бұрын
for some reason I have written the code properly but when i press the arrow keys it doesn't always register it and I thought it was a matter of multiplying with deltatime but it still doesn't work. Can someone help?
@NicoV23 жыл бұрын
i got an error saying that: AttributeError: 'builtin_function_or_method' object has no attribute 'tick' i used python 3.9.1 to code this
@zhankam73082 жыл бұрын
thanks for the video, but I have an error in PowerShell at the beginning
@Niels2Oyes2 ай бұрын
There is one bug: if you slide in the ball with the player, it's going to do ball_x/-1 multipule times. The bal will get a few seconds stuck in the player, it's really annoying. I can't find a solution for this. Does somebody have one?
@MrFeivelinho4 жыл бұрын
Easily one of the best tutorials on coding i have seen so far. Does anybody know how difficult it would be to add multiplayer (via internet) to the game?
@rajab41874 жыл бұрын
APIs
@BabyQuasarX Жыл бұрын
The ball_animations function does not allow the player and opponent variables to operate correctly. As far as the computer is concerned, those variables only exist outside of this function. How do you go about solving this issue?
@iceisspider38603 жыл бұрын
How did you get this black bacground in python
@YakyuBoy2 жыл бұрын
Why does ball_speed_x and ball_speed_y need a global definition but not player_speed?
@YakyuBoy2 жыл бұрын
Nevermind, I saw your reply in another comment. Thank you! Clear Code 2 years ago When using the player_speed variable it is only used by the player_animation function, the function does not change the value (so if you wanted to change the speed of the player from the function you would need to declare it a global variable. Both the ball_speed variables change the variable from within the function; i.e. you are trying to change a global variable from a local scope. Hope that makes sense :)
@janl52422 жыл бұрын
Great stuff, thanks :)
@vedantpandey40792 жыл бұрын
Hey, awesome tutorial, keep up the good work! One very minor error, at 17:41 it says "Colissions" instead of "Collisions".
@lu34z Жыл бұрын
For anybody having an error with the keys at 23:20 getting the error "K_DOWN not defined". All you have to do is at the top say "from pygame import *" and it should fix it.