Learn Pygame by developing Pong game
In this tutorial I am going to show you how to make Pong, a simple but very addictive game that was released back in 1973 by Atari. It is a very simple game by today's standards but it was a massive hit in its day. We are going to build this game using Python and the Pygame module.
Although Pong is a very simple game, it covers a lot of the aspects of computer game programming, like movement, control, collision detection, scoring, artificial intelligence and so on. If you learn how to program Pong you will be able to program a lot of other games as well.
Code of the project: https://github.com/educ8s/Python-Pong-Game-with-Pygame
Python cheatsheet: https://bit.ly/3osnz6l
Pygame cheatsheet: Still working on it. Check back tomorrow.
0:00 Intro to the game
2:25 Install pygame
3:30 Create a blank screen & the game loop
10:34 Draw the arena, the paddles and the ball
18:28 Move the ball around
21:01 Check for a collision with all edges
25:21 Move the player's paddle
29:22 Move the cpu paddle with AI
32:18 Check for a collision with the paddles
33:26 Add scoring