Learn Python by Building Five Games – Full Course
Learn Python in this full tutorial course for beginners. This course takes a project-based approach. We have collected five great Python game tutorials together so you can learn Python while building five games. If you learn best by doing, this is the course for you.
? Learn Python syntax in our other Python course:
? Learn Pygame:
⭐️ Course Contents ⭐️
⌨️ (0:01:18) Pong
? Sound file:
? Code:
? Tutorial from Christian Thompson. Channel:
⌨️ (0:45:36) Snake
? Code:
? Tutorial from Tech with Tim. Channel:
⌨️ (1:34:57) Connect Four
? Code:
? Tutorial from Keith Galli. Channel:
⌨️ (2:42:36) Tetris
? Starter File:
? Full Code:
? Tutorial from Tech with Tim. Channel:
⌨️ (4:22:12) Online Multiplayer Game
? Code:
? Tutorial from Tech with Tim. Channel:
—
Learn to code for free and get a developer job:
Read hundreds of articles on programming:
And subscribe for new videos on technology:
The first game was sooo nice to remake myself for practice!! Had tons of fun!
@Владимир Даль i can not help with that, sorry.
@sam glover pc
what should i do if my ball is so fast? Who knows?
@Mr Shades i just rebuilt it and it fixed it. Idk
My man, i am a beginner and I have a doubt about “how to learn”, like I don’t have any idea how to build a tetris game for example, or a project from “Top Python Projects for beginners” like I found on internet, picking the tetris example, for I to be able to learn how to build it, should I watch the tutorial, get some notes and try to rebuild it or idk, maybe I am doing wrong, because I feel like it’s just a really giant universe that it’s not like a linear path where i can say: “well, today i’m going to study this so I can follow this study planning so by the end of the month I will be able to build a tetris game because I will know all the necessary things, it’s not like math, if you know what I mean
This was the most straight-forward Python tutorials I have seen so far. The people are really good at coding and explain things really well! I will definetly recommend this channel to my friend who also wants to learn Python. Thanks again for teaching me and other people Python!
just finished Pong and added an extra feature, when the ball hits the paddle it increases speed by multiplying dx and dy by 1.03, it gives a really smooth increase in difficulty as the ball bounces and makes the game more interesting.
to apply this simply add “ball.dx *= 1.03” and “ball.dy *= 1.03” at the end of both paddle collision functions.
ps. thanks free code camp for helping me find easier to interpret information on how to code, if I didn’t see this and python for beginners or something like it, I would still be spending my nights confused or playing videogames instead of learning something useful.
@Leul Getachew it would be as simple as setting the speed to what you want every time the game starts again.
@Leul Getachew Yeah, there is. Since you always want dx and dy to start the same, you can just say “ball.dx = [whatever]” and “ball.dy = [whatever]” when someone scores
@Mateus Ferreira is there a was to make it reset the speed after you score?
is there a was to make it reset the speed after you score?
b increase i mean
I just finished the full video over the last week while following along and I’m very proud of myself, and excited to see what I can do, on top of visiting the more advanced lessons. I’ll definitely be back, I’ll definitely be donating, and I’ll definitely be recommending to others. Thanks for sharing.
Thanks buddy
At 9:37 you talk about the importance of testing as you go. This is SO true! At one point I accidentally put paddles after main loop, and it broke everything haha. Took me five minutes to realize what I’d done, but I learned from it, so it worked out 🙂
same!
My man: I can’t express enough gratitude on how you explain everything! Without a doubt one of the best courses. You teached me the basics under 24h + you made me want to dive deeper instead of falling a sleep.. THANKS THANKS THANKS!!
The tutorials give a great insight in how to code in Python. I do have one big comment on these tutorials. Always use readable and understandable names for variables, functions, etc. So not ‘w’ but ‘width’ or even better ‘windowWidth’. Don’t cheap out on this. The IDE’s these days do a great job with intellisense for this. Solid and readable code is sooo important in order to deliver great code.
First tutorial was awesome, with a wonderful progression of how the most basic of games are made. Second one (snake) not so much. Very haphazard with little to no explanation on how to properly set up your game environment or the objects within them.
I agree.
I know this comment is 5 months old but I agree completely. While I’m grateful for a free tutorial, since I like to write the code on a notebook and then pass it on through python, it was very confusing when he would just add code and then 2 minutes later say, “oh, you can just erase this”. again, grateful to these guys for the tutorials but it’s really hard to keep up.
I am a brand new coder, with no expirience. Finding an actually helpful video has been really difficult, but this one helped out more than I can explain. Thank you so much, just the first program about pong showed me more about game design and code than I ever would have though I would know
The first tutorial is the best!
the teacher explains EVERYTHING and advices on the little details we have to focus on.
00:00 Pong
45:38 Snake
1:35:05 Connect Four
Timestamp: 51:00
Thank for the stamp
Lmao its in descriptio
cool
but its in the description
thanks mate
Hi, excellent tutorial, i wanted to ask if there was a more optimal way to do the Pong game using for example class objects for paddles and the ball for example, thanks.
It’s not the most optimal since it’s a really simple game; it’s not worth creating classes and objects for 2 paddles and 1 ball. But if you want to practice object-oriented, you can do some exercises from UTN FRC, they are great.
To anyone who is struggling with the second tutorial (snake), I would highly recommend watching this video first that goes over classes https://www.youtube.com/watch?v=JeznW_7DlB0 (its much more beginner friendly) and then coming back to snake. It will make so much more sense. I got through half of the snake game but felt like it was too complicated and I wasn’t actually learning anything. After watching the video on classes I came back and looked at the code I had written thus far for snake and it makes so much more sense.
Awesome tutorial so far. I finished the pong one with no issues. Although I’m stuck at the very end of the snake game where the entire game crashes if the snake eats itself. Has anyone else come across this issue? I believe it has something to do with “` root = tk.Tk() “` in the message_box function. As soon as it comes across that line python shuts itself off.
The pong tutorial was great. Christian is an excellent teacher who understands how to teach. He kept hammering home that we should always write a little code to check if it works. The second video with Tim has been pretty horrible. He throws all that advice away and just codes blindly for a long time before explaining anything. I am going to complete the connect 4 tutorial next but the snake one was a huge waste of time. I don’t know whats going on and I don’t really have much leg to stand on to make this work. Seeing at the Tetris and multiplayer one are also from Tim, I will probably not do those. I was hoping the snake tutorial would teach object oriented programming but it was just a code along with little stopping to explain anything.
I think one thing I would like from both videos are instructions on how to set up and download all packages. I feel like pure beginners will really trip up on that.
The 2nd video illustrates why you should check your code from time to time.
@Davy Roger exactly
My man, i am a beginner and, i have a doubt about “how to learn”, like I don’t have any idea how to build a tetris game for example, or a project from “Top Python Projects for beginners” like I found on internet, picking the tetris example, for I to be able to learn how to build it, should I watch the tutorial, get some notes and try to rebuild it or idk, maybe I am doing wrong, because I feel like it’s just a really giant universe that it’s not like a linear path where i can say: “well, today i’m going to study this so I can follow this study planning so by the end of the month I will be able to build a tetris game because I will know all the necessary things, it’s not like math, if you know what I mean
Thank you for this comment and I 100% agree with you. Christan explained it really well and when I had an error I easily figured out what I had did wrong. Tim not so great
Great video and tutorial! thanks for your time and efforts!
For those who are trying to make the pong game into a .exe file and are getting an fatal error:
Put the whole while loop into an except like this:
try:
while true:
(code)
except:
pass
when writing valid_space() function for TETRIS, you can just simply write:
accepted_pos = [(i,j) for i in range(20) for j in range(10)]
or
accepted_pos = [(i,j) for i in range(20) for j in range(10) if grid[i][j] == (0,0,0)]
and you don`t need to flatten it out. It’s already a list of unembedded tuples
Thank you so much! I’m just starting with Python and VS and this tutorial is so helpful! ❤️??
Learn by doing!! Thank you so much. 5 mins in and have learned more than a 6 week course for beginners