Pong with Python & Pygame – Tutorial

preview_player
Показать описание
Improve your Python and Pygame skills by building the classic pong game, but this time with extra features. This beginner's tutorial is a great way to start learning how to create engaging games with unique mechanics.

✏️ Course created by @SMDS_Studio

⭐️ Contents ⭐️
(00:00) Intro
(01:09) Agenda of the course
(02:04) Traditional pong
(26:09) Creative angles
(30:21) Smash element
(38:03) Flash element
(41:10) Ball cloning
(51:51) Paddle cloning
(1:01:55) End screen element

🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 南宮千影
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan

--

Рекомендации по теме
Комментарии
Автор

Thank You so much everybody for watching this tutorial. Firstly, There will be a lot of people thinking why didn't I use classes annd objects in the code for the paddles, ball, etc. But then according to me, classes cannot be easily understood by beginners unless they know it. Now again we have some more amazing pygame tutorials such as writing your own name on the pygame window and we specialize towards machine learning on our main channel. So you might as well be interested in that.

SMDS_Studio
Автор

This was great! I'm a Python beginner but I feel like I learned a lot just by going through this tutorial. The results are very satisfying.

starwyvern
Автор

Very nice tutorial indeed! I followed through what you've written, and creating thus, 4 different pong versions! The code and the explanations were simple and clear enough, even though in the later stages, with the cloning of the paddles and the dummy ball, I got a bit confused with all the copy and paste to do! Looking forward for the next project!

witt
Автор

05:45 Noob here. Can you explain why 'if __name__ == "__main__":' isn't used?
Also is there a reason for not creating a paddle & ball classes and objects?

BsktImp
Автор

My left paddle is not moving, can you please help me?

akinjareolamide
Автор

Can we create framework in python? Yes, how

bishambarsharma
Автор

Hello SMDS, sorry for asking such a newbie question here. While I'm half way through your tutorial and currently implementing the left paddle collission, I'm really confused about these lines:

if left_paddle_x <= ball_x <= left_paddle_x + paddle_width:
if left_paddle_y <= ball_y <= left_paddle_y + paddle_height:

How or why do we need multiple two "<=" operations in a single statement? Is this really necessary? Could this have been accomplished with just one "<=" operation? Aren't we trying to determine if the ball has exceeded the paddle's left coordinates + its width?

In fact, if I change what you instructed in the tutorial to:

if ball_x <= left_paddle_x + paddle_width:
if ball_y <= left_paddle_y + paddle_height:

...the left paddle collission seems to work fine. What am I missing here?

lesterjackson
Автор

I would love to start coding. What sould I learn first?
Or where should I start if I am not able to go to University?

FakeZOOr
Автор

uh noob here what app are you using a want to get into python

Lyricy
Автор

Sir, upload full bash scripting course

s.p.sanjay
Автор

spaghetti code in python -using pygame

marioamatucci
Автор

Please make video on ROS OR ROS2 #PLEASE #PLEASE😢

DataScienceWithAkesh
Автор

Hello,
I wasn't able to get the circle on the screen at all.
I tried two methods.
1. pygame.draw.circle(screen, (230, 0, 0), (300, 250), 25 )
and when it didn't work I used the one shown in the video but I still wasn't able to get it. Can anyone help me?

my code:  
import pygame
pygame.init()

width, height = 600, 500
screen = pygame.display.set_mode((width, height))
game")

run = True

BLUE = (0, 0, 255)
radius = 15
ix, iy = width/2 - radius, height/2 - radius

#main game loop
while run:
for i in pygame.event.get():
if i.type == pygame.QUIT:
run = False
#pygame.draw.circle(screen, (230, 0, 0), (300, 250), 25 )
pygame.draw.circle(screen, BLUE, (ix, iy), radius)

topplewear
Автор

Can we create framework in python? Yes, how

bishambarsharma