Python Game Tutorial: Pong

preview_player
Показать описание
A Pong clone game tutorial for beginners using Python 3.

⭐️Course contents ⭐️
⌨️ (00:00) Part I: Introduction and the basic window setup
⌨️ (03:32) Part II: Add game objects to the screen (Paddles and Ball)
⌨️ (09:15) Part III: Moving the Paddles
⌨️ (15:06) Part IV: Moving the ball
⌨️ (24:10) Part V: Colliding with the Paddles
⌨️ (30:47) Part VI: Scoring
⌨️ (37:57) Part VII: Adding Sound

--

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

Build a game, no matter how simple, always makes learning a new language more fun and motivating. Thank you!

mikemindacodemy
Автор

This is my first-ever (finally) attempt at coding something in Python. After dozens of "learn python in x-hours" videos, I finally realized I needed a specific goal, and pong was recommended. I had to pause at 32min to just play my pong game, with the biggest grin on my face. Thanks so much for this tutorial, it's EXACTLY what I needed to finally jump into coding.

joebot
Автор

Me: *Gets a black box to appear on the screen*
*Smiles Proudly*

noodles
Автор

richards from silicon valley was right, spaces are annoying just use tabs

protoactivenuclear
Автор

Starting at 40:49, the sound comes after the ball hits the coordinates because that is where it is placed in the program. If you move the sound to right after the if statement, it will occur in the correct order hit-sound-rebound. I do not have Python and have never programmed in it but I used to be a Visual Basic programmer years ago (VB 6). Now I am a sys admin. I kind of miss programming. I followed the logic perfectly in this video despite that fact. I believe I will try it now that I have watched this. Thank you! This is awesome! It reminded me how much fun programming was!

anonymoustechgeek
Автор

Me: copies everything he did but the color and size ratio's
Also Me : i am programr

crunchygs
Автор

Do a beginners tutorial on how to program a game like "Fallout 4" using turtle in Python. It may need a few extra lines of code.

TheWorldsStage
Автор

I watched the whole 44min and I was not bored a second. I loved it, thanks for the great tutorial, please make more!

sireopossom
Автор

@ 23:50
instead of sending the ball to 0, 0 when it collides with the x boundaries, i used:
ball.goto(390, ball.ycor())
and
ball.goto(-390, ball.ycor())
This is preserving continuity of the game, instead of directly sending the ball at center.

abhijeetkushwaha
Автор

Finished. I never thought I could code a game until I watched this video. Thank you, Christian!

chrispowell
Автор

i dont know if i missed it, but if you wanna end the game you can do something like this at the end of it all under the while True loop.

# game over
if score_a == 5:
pen.clear()
ball.dx = 0
ball.dy = 0
ball.goto(0, 0)
pen.write("Player A wins!!!", align="center", font=("courier", 32, "normal"))

if score_b == 5:
pen.clear()
ball.dx = 0
ball.dy = 0
ball.goto(0, 0)
pen.write("Player B wins!!!", align="center", font=("courier", 32, "normal"))

jamesleibee
Автор

instead of ball.shape("square"), do ball.shape("circle")

antonkarolik
Автор

this is probably the best coding tutorial i have watched so far. He explains everything super well for those who have never used turtle before. He simplifies everything and takes his time instead of speeding through it. I really want to see a snake game tutorial by this guy but I hope he teaches us how to make a grid instead of just a dark backround because a grid looks much better and makes it easier to play the game

logandukes
Автор

Thank you for this great tutorial!
If someone wants to limit paddles movement in y direction you can do this:

def paddle_a_up():
y = paddle_a.ycor()
if y < 250:
y += 20
paddle_a.sety(y)

def paddle_a_down():
y = paddle_a.ycor()
if y > -250:
y -= 20
paddle_a.sety(y)

dreggeth
Автор

31:25 "I just call it a pen, but it's actually just a turtle" - Smart computer man, 2020

josephshaw
Автор

Thank you so much for taking time aside to help people code, coding can be very hard without basic information, and what you do so helpful, please keep uploading. (Sorry for the grammar mistakes, English isn't my native language)

maayancole
Автор

This is the best tutorial about a project in python. Thanks so so so much!

harmannatsingh
Автор

Thanks so much for this. I am super new to coding and found this and decided to give it a try. I still have a long way to go, but I’m having fun.
I hope to learn more with your videos and free code camp soon.

LunaBellaRosa
Автор

I don't know why I was so happy when the black square appeared on my screen

nowybopes
Автор

9:37 I have never seen someone need more effort to write the word Function. Overall a great video for beginners

IamnotGW