Me: *Gets a black box to appear on the screen* *Smiles Proudly*
@chriscreates77724 жыл бұрын
me
@47noodles4 жыл бұрын
Christian Thompson I done now, I even figured out how to get the ball to go faster at every bounce
@goku4454 жыл бұрын
I had to work to ge to that point. Linux python install versioning shitfest...
@seventyfox74424 жыл бұрын
@@TokyoEdTech Wow! I think that it is really cool that you are still responding to these comments, even after about a year of this being up. I watched this video a while ago and it jump-started my passion for coding, so thank you!
@cal8474 жыл бұрын
ha, me too. that made my day.
@mikemindacodemy72795 жыл бұрын
Build a game, no matter how simple, always makes learning a new language more fun and motivating. Thank you!
@goku4454 жыл бұрын
I always start with a pong whenever I want to learn a new language :D
@Jojo-cs4bl4 жыл бұрын
Whan I wirt square it say error 😩
@samisha91453 жыл бұрын
We made a pong game in Python using the Turtle and Freegames libraries. kzfaq.info/get/bejne/h7Z7gqWWs922kp8.html
@joebot0015 жыл бұрын
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.
@zachface.194 жыл бұрын
It's been 5 months since you said this. How much more would you say your coding has improved?
@markuskorpijarvi55384 жыл бұрын
@@zachface.19 Its 6 months
@markuskorpijarvi55384 жыл бұрын
@@zachface.19 How much do You haves?
@user-xq2dz4rp9k4 жыл бұрын
It's been 9 months since you said this. How much more would you say your coding has improved?
@bravosix81714 жыл бұрын
Have you learned? Plz tell
@crunchygs87714 жыл бұрын
Me: copies everything he did but the color and size ratio's Also Me : i am programr
@TheComedyBlackGuy4 жыл бұрын
literally
@tankytitan13044 жыл бұрын
The program is easy if you know math
@rayanking47734 жыл бұрын
i don't think is a good way that's a video for learning not for copy
@Zubs15074 жыл бұрын
lol
@Itz_me_JB4 жыл бұрын
its fine to copy the code the point is to make sure to understand it
@TheWorldsStage4 жыл бұрын
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.
@cOnT3ST4 жыл бұрын
Or maybe he should just recode "Fallout 76"
@cOnT3ST4 жыл бұрын
@@linushallgren4156 Of course he wasn't. what made you think so???
@TheWorldsStage4 жыл бұрын
@@linushallgren4156 So, maybe like, 20 extra lines of code?
@cooperbrahmsteadt51234 жыл бұрын
Whitney 25 at most
@xdemoman36924 жыл бұрын
@@cooperbrahmsteadt5123 Maybe 30, but that's only when worst comes to worst.
@protoactivenuclear77275 жыл бұрын
richards from silicon valley was right, spaces are annoying just use tabs
@peesicle4 жыл бұрын
Yeah he was also nice to see someone who actually watches something i watch
@sireopossom78603 жыл бұрын
I watched the whole 44min and I was not bored a second. I loved it, thanks for the great tutorial, please make more!
@English.with.Mateusz2 жыл бұрын
did you continue your journey with Python?
@josephshaw27473 жыл бұрын
31:25 "I just call it a pen, but it's actually just a turtle" - Smart computer man, 2020
@TokyoEdTech3 жыл бұрын
Thanks - I try.
@anonymoustechgeek4 жыл бұрын
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!
@antonkarolik69934 жыл бұрын
instead of ball.shape("square"), do ball.shape("circle")
@user-ze3ui8ur9h2 жыл бұрын
i believe this was inspired by the original version of pong.
@kiddo75622 жыл бұрын
thanks u made it look better and interesting :)
@ankeet40442 жыл бұрын
it looks more retro with square.
@abhijeetkushwaha4245 жыл бұрын
@ 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.
@chrispowell81214 жыл бұрын
Finished. I never thought I could code a game until I watched this video. Thank you, Christian!
@TokyoEdTech4 жыл бұрын
You're very welcome - keep on codin'!
@LunaBellaRosa5 жыл бұрын
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.
@logandukes59844 жыл бұрын
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
@TokyoEdTech4 жыл бұрын
Thanks! I have a snake tutorial, but no grid - sorry.
@jamesleibee8902 жыл бұрын
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"))
@maayancole4 жыл бұрын
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)
@harmannatsingh39334 жыл бұрын
This is the best tutorial about a project in python. Thanks so so so much!
@CarlC98985 жыл бұрын
Thanks for this awesome tutorial! The game is working great for me (I just needed to change the ball.dx and ball.dy to 0.2 and -0.2 respectively). I'm going to try and make another game using the turtle module and the techniques I learned in this video.
@lannyboover2295 жыл бұрын
oh, thnx for your ball speed advice
@jrezzi13085 жыл бұрын
# Simple Pong in Python 3 for Beginners # By @TokyoEdTech import turtle import os wn = turtle.Screen() wn.title("Pong") wn.bgcolor("black") wn.setup(width=800, height=600) wn.tracer(0) # Score score_a = 0 score_b = 0 # Paddle A paddle_a = turtle.Turtle() paddle_a.speed(0) paddle_a.shape("square") paddle_a.color("white") paddle_a.shapesize(stretch_wid=5,stretch_len=1) paddle_a.penup() paddle_a.goto(-350, 0) # Paddle B paddle_b = turtle.Turtle() paddle_b.speed(0) paddle_b.shape("square") paddle_b.color("white") paddle_b.shapesize(stretch_wid=5,stretch_len=1) paddle_b.penup() paddle_b.goto(350, 0) # Ball ball = turtle.Turtle() ball.speed(0) ball.shape("square") ball.color("white") ball.penup() ball.goto(0, 0) ball.dx = 2 ball.dy = 2 # Pen pen = turtle.Turtle() pen.speed(0) pen.shape("square") pen.color("white") pen.penup() pen.hideturtle() pen.goto(0, 260) pen.write("Player A: 0 Player B: 0", align="center", font=("Courier", 24, "normal")) # Functions def paddle_a_up(): y = paddle_a.ycor() y += 20 paddle_a.sety(y) def paddle_a_down(): y = paddle_a.ycor() y -= 20 paddle_a.sety(y) def paddle_b_up(): y = paddle_b.ycor() y += 20 paddle_b.sety(y) def paddle_b_down(): y = paddle_b.ycor() y -= 20 paddle_b.sety(y) # Keyboard bindings wn.listen() wn.onkeypress(paddle_a_up, "w") wn.onkeypress(paddle_a_down, "s") wn.onkeypress(paddle_b_up, "Up") wn.onkeypress(paddle_b_down, "Down") # Main game loop while True: wn.update() # Move the ball ball.setx(ball.xcor() + ball.dx) ball.sety(ball.ycor() + ball.dy) # Border checking # Top and bottom if ball.ycor() > 290: ball.sety(290) ball.dy *= -1 os.system("afplay bounce.wav&") elif ball.ycor() < -290: ball.sety(-290) ball.dy *= -1 os.system("afplay bounce.wav&") # Left and right if ball.xcor() > 350: score_a += 1 pen.clear() pen.write("Player A: {} Player B: {}".format(score_a, score_b), align="center", font=("Courier", 24, "normal")) ball.goto(0, 0) ball.dx *= -1 elif ball.xcor() < -350: score_b += 1 pen.clear() pen.write("Player A: {} Player B: {}".format(score_a, score_b), align="center", font=("Courier", 24, "normal")) ball.goto(0, 0) ball.dx *= -1 # Paddle and ball collisions if ball.xcor() < -340 and ball.ycor() < paddle_a.ycor() + 50 and ball.ycor() > paddle_a.ycor() - 50: ball.dx *= -1 os.system("afplay bounce.wav&") elif ball.xcor() > 340 and ball.ycor() < paddle_b.ycor() + 50 and ball.ycor() > paddle_b.ycor() - 50: ball.dx *= -1 os.system("afplay bounce.wav&")
@dreggeth2 жыл бұрын
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)
@ursomrano5422 жыл бұрын
A cool little thing you can add to the code as well is a direction randomizer every time the ball is in the center by importing "random" and then adding something like this: if ball.xcor() == 0 and ball.ycor() == 0: firstDirection = random.randint(0,3) if firstDirection == 1: ball.dx *= -1 ball.dy *= 1 elif firstDirection == 2: ball.dx *= 1 ball.dy *= -1 elif firstDirection == 3: ball.dx *= -1 ball.dy *= -1 in the "#Move the ball" section of the while loop :)
@danielmoreno9682 жыл бұрын
Thank you!
@thatwholesomeindian33054 жыл бұрын
im having problems every time i try to run it, it says in the terminal invlid syntax
@nowybopes4 жыл бұрын
I don't know why I was so happy when the black square appeared on my screen
@rayanking47734 жыл бұрын
me too xd
@latifasebti79134 жыл бұрын
itz becuz u feel u did something great and u didn't do any falt and ur so proud of yourself
@thisthelongestnameonyoutub21903 жыл бұрын
Me Too!
@hypersound16123 жыл бұрын
It’s not popping up on mine
@blue_is_cool163 жыл бұрын
@@hypersound1612 make sure to open the python IDLE program too.
@marcfoster7154 жыл бұрын
print("The only winning move is not to play.")
@hillybankok2 жыл бұрын
You've... Been.... Trolled! You've been trolled, Yes you've probably been told!, Don't reply to this guy, he's just trying to get a rise.. OUT OF YOU! Yes it's true! You respond, and that's his cue! To start trouble on the double, while he strokes his madly stubble!, You've been trolled, you've been trolled! You should probably just fold! When the only winning move is not to play! And yet, you keep on trying, mindlessly REPLYING! You've been trolled, you've been trolled! Have a nice daaaaaaaaaaay.!!
@IDrive3055 жыл бұрын
you should explain that if ball.dx is set too high at 2 use fractions your code should look like this : ball.dx = 1/5 ball.dy = 1/5 adjust bottom half of the fraction to your desired speed
@IDrive3055 жыл бұрын
or decimal
@shivamjalotra79195 жыл бұрын
this thing is self-explanatory
@IDrive3055 жыл бұрын
Christian Thompson I like your vids great work
@shivamjalotra79195 жыл бұрын
@@TokyoEdTech Great work from your side. Love it.
@uahatoxicboi98015 жыл бұрын
C R thanks I appreciate
@shalonemadre4884 жыл бұрын
That was very helpful with my school project, thank you very much for the help.
@_HARAA_3 жыл бұрын
no one could have made it any easier and motivating, thank you
@annielouise11413 жыл бұрын
my ball is not moving..
@thatgarryman94006 ай бұрын
No "WHAT'S UP GUYS, BEFORE WE START THIS VIDEO" stuff for 2 minutes, just the real deal. Immediate like.
@publicstaticvoid32245 жыл бұрын
Thank you very much for making this tutorial. I appreciate the hard work you put into this bro! Everything worked perfectly ;)
@ebentee5 жыл бұрын
It dies work for me
@TheBobstar895 жыл бұрын
24:35 why is there a 10px offset that causes the ball to go off the screen instead of stopping at the window corner?
@RotemEren3 жыл бұрын
Short and to the point. Well done.
@Hilqy3 жыл бұрын
way more useful than my teacher, learned more here than I have this month
@TokyoEdTech3 жыл бұрын
Thanks - glad you found it useful!
@Berzerker-4 жыл бұрын
hey i got a problem where my ball speed isnt constant even though i have the same exact code as the tutorial, anyone know how to fix this ?
@TheBerkaay3 жыл бұрын
I have the same problem. Were you able to find a solution?
@kiwan74113 жыл бұрын
he litterly sedd how to fix it
@kiwan74113 жыл бұрын
@Waleed في الشلال well its kinda hard to explain just watch the video again or something
@vicfic_3 жыл бұрын
@Waleed في الشلال , @Berksater in the # ball section there are two variables named ball.dx and ball.dy. Lower its values from 2 to 0.1 or something.
@kingannihilator83863 жыл бұрын
this is the most useless reply section i have ever seen
@samshanmukh5 жыл бұрын
I think adding the ampersand (&) at end of the file tells to run the command in the background for unix-based systems.
@mdempse15 жыл бұрын
Great tutorial. Got the sound working in windows and now I just need to figure out how to make the paddles get continuous input from a held down key and make it faster/smoother. Learned a lot. Thanks!
@mdempse15 жыл бұрын
@@TokyoEdTech Nice, I will give it a try.
@RahulRoy-ct7ni Жыл бұрын
what is the command for window for the sound?
@IamnotGW Жыл бұрын
9:37 I have never seen someone need more effort to write the word Function. Overall a great video for beginners
@elbow34225 жыл бұрын
Hello, I followed through the whole tutorial and now at the end I'm trying to make a timer for the game. I successfully made the timer just how I wanted but it froze everything else in the game. I'm pretty sure the problem is that the loop is waiting for the timer to finish until it goes again, but I want the game and timer to run simultaneously. Any ideas?
@abdurrahman.maricar4 жыл бұрын
Having issues with sound on Windows, Whenever it touches the wall or the paddle it gives a Windows error sound instead of the bounce sound that I had downloaded
@ogunkayodeoluwaseun93484 жыл бұрын
Same here and my pad runs off the screen too
@sohitbagga7124 жыл бұрын
did you save your sound file in .vscode folder?
@ladzsn53144 жыл бұрын
@@sohitbagga712 where is the folder
@u4tiwasdead4 жыл бұрын
if you still want to know, if you just wrote the filename e.g. "bounce.wav" you need to write the full filepath instead e.g. "C:/Users/files/bounce.wav"
@abdurrahman.maricar4 жыл бұрын
@@u4tiwasdead Thanks alot
@wesusaa4 жыл бұрын
Really good video! I was really happy with how it turned out! I made some adjustments so they paddles didn't go off screen, but the explanation was so well made!
@zackcordle48142 жыл бұрын
How did you code them so they don't go off screen?
@mohammedirfan17394 ай бұрын
broooooo thank you soo much man i was scared that i would fail my test but you saved my 🥺
@luka89664 жыл бұрын
This is a very good tutorial and I very recommend it. It was easy to understand and I might actually stand a chance at creating games in the future. After it finished, I managed to: Make it slowly get faster, make it so both players can create there own names and make the game a best of 5 where your paddle gets smaller for every point you get and it even comes up with text at the end saying who won. Thank you!
@spekkio774 жыл бұрын
nice going, I also made it slowly get faster and then reset when the ball goes out. I like the idea of the paddle getting smaller, I may try that. Another fun idea I might try is to change the angles (dx / dy) depending on where the ball hits the paddle
@derpdarko3 жыл бұрын
For windows you have to do winsound.Beep(800, 75) (you can change the numbers if you want you should end up with this import winsound winsound.Beep(800, 75) Edit: Only if the first method doesn't work
@twodays80414 жыл бұрын
I can't believe I just programed a game, thank you
@TokyoEdTech4 жыл бұрын
You're welcome!
@jakubpesko80712 жыл бұрын
for the ones who dont knows how to make borders for the paddles here you re if paddle_a.ycor() > 250: paddle_a.sety(250) if paddle_a.ycor() < - 250: paddle_a.sety(-250) if paddle_b.ycor() > 250: paddle_b.sety(250) if paddle_b.ycor() < - 250: paddle_b.sety(-250)
@ullwor2 жыл бұрын
thx man, that's exactly what i was looking for :D
@ferax45984 жыл бұрын
Ahh finally I'm done Christian: *AaAAaanDd*
@ferax45984 жыл бұрын
@@TokyoEdTech lol
@itstoufik84103 жыл бұрын
thank you for the tutorial!
@TokyoEdTech3 жыл бұрын
You're welcome!
@greenbeanmanz4 жыл бұрын
This was great!!I had to figure out how to show the turtle window and stuff on windows because the way visual studios was set up. I didn’t add sounds because I didn’t want to mess anything up and I didn’t want to spend any more time. Great tutorial!!!
@TokyoEdTech4 жыл бұрын
Thanks!
@Galileo3k5 жыл бұрын
Wow! You are really crystallizing many concepts of my early studies of python. I will watch more.
@joost_schiphorst4 жыл бұрын
my ball has different speeds, i dont know why, how do i solve it? the best speed on my computer is 0.13
@diegoolivera52614 жыл бұрын
did U find a solution to it, I'm having the same problem
@joost_schiphorst4 жыл бұрын
@@diegoolivera5261 nope, I wish I had
@josephreed32874 жыл бұрын
Joost Schiphorst I’m having the same issue as well. And what I believe is happening is that your pc is using up less processing power at some points and in those moments, the ball moves faster because the ball is set to move based on how quickly your pc can update it. But I’m not 100% sore about that so take it at face value. Lol I do believe there is a way to fix it but it’s currently 2 am for me. I’ll look it up tomorrow and let you know if I’ve found a fix or not.
@ishank72394 жыл бұрын
Has someone found the fix ?
@a.a87204 жыл бұрын
1/2
@jaytea235 жыл бұрын
Great tutorial! Only issue I'm having is with the 'w' key. I can't hold it down and continue to move up like I can with the other keys. Anyone else having this issue?
@Shikigami65 жыл бұрын
same, but set the movement of the b paddle to o for up and p for down, and here i can only hold-move the up-movement. Have you solved the problem yet?
@a2kvarnstrom804 жыл бұрын
here is the code: def paddle_a_up(): y = paddle_a.ycor() y += 20 paddle_a.sety(y) wn.onkeypress(paddle_a_up, "w")
@maxtaylor124 жыл бұрын
You are getting this issue because when you did not write your code right. Just copy it line for line. Dont forget to change each var for each function you change it for (a,b)
@vaibhavsharma9854 жыл бұрын
Here is the solution Take two Boolean variable s pressed_up and pressed_down initialised as false Then in game loop place following code If event.type==pygame.KEYFOWN: If event.key==pyame.K_W: pressed_up=True elif event.key==pygame.K_S:pressed_down=True elif event.type==pygame.KEYUP: if event.key==pygame.K_W: pressed_up=False elif event.key==pygame.K_S:pressed_down=False Then outside the event loop write If pressed_up: xcord-=1 elif pressed_down: xcord-+=1
@Nate-er1fb3 жыл бұрын
You must have placed it under the "while true loop"
@wasadasa15 жыл бұрын
For paddle and ball collisions I used absolute value function for the distance between the core of the ball and paddle, it's easier and doesn't cause the ball to stuck behind the paddle.
@chinmayat.s3795 жыл бұрын
Please read it full The best tutorial, i ve never come across.... truly amazing... such a clean and clear explanations... step by step detailed explanation made us easy to swallow the whole concept... now i think i can write a new game by own... Thanks for that Sir. But there is a problem sir, When i wrote the program, the game worked fine apart from one thing... ball bounces and returns at a distance from the paddle.. i tried by changing the distance in if loop and setting x value like 340 to 350... and to know whether its entering the loop, i printed something.. now prints the movement it bounces back. that means it is entering the loop... and even the sound is now working in that loop Note: this problem is only with the right paddle, which is in the +ve x direction.... i will be glad if you help me out from this... expecting your reply... thank you... Chinmaya from India...
@sgeasley5 жыл бұрын
Yo my dudes, loving this channels 'simple' yet effective tutorials, thank you so much! Having alot of fun here :) Edit: Helps that you guys dont rush things and like to recap before moving onto next!
@AamirKhan-zy5yt5 жыл бұрын
Which text editor he is using?
@alyz27985 жыл бұрын
Microsoft visual studio code, free btw
@jackphillips4975 жыл бұрын
Great video for beginners in python (like me) to learn a simple yet interesting game! I did it on windows and followed this video step by step pretty much and everything works perfectly. I was using python 2 and had to take away a bracket and add a colon on the 'if ' function in 'paddle and ball collisions". Overall amazing Video. :)
@jackphillips4975 жыл бұрын
@@TokyoEdTech Your very welcome.
@julianwilliams24395 жыл бұрын
how do i make it so paddle a is able to be hit by the ball its not working!!!!
@lemoonadee3 жыл бұрын
this was fun to learn
@TokyoEdTech3 жыл бұрын
Thanks - glad to hear it!
@sliferslacker67634 жыл бұрын
Personal Time stamp, please ignore. 19:55
@wehavedonuts77674 жыл бұрын
A. Human no
@goku4454 жыл бұрын
Which kind of browser you use? On Firefox if you quit (closing tab) a video half way and come back, your session is saved where you left it.
@Acidpop4 жыл бұрын
@@goku445 thats because of youtube not Firefox
@crunchygs87714 жыл бұрын
@@Acidpop lmao ikr i legit hit facepalm when i read that thank you for protecting and serving *massive salute*.
@dominator16995 жыл бұрын
im pretty sure i copied the code correctly but the paddles can go off screen, did i do something wrong or did he not code that part?
@peterkrogh1863 Жыл бұрын
Great tutorial, easy understandeble and good explaining on what does what, so oneself can improve a bit on the programming like not make the bat go off screen and whatever comes to mind :)
@tinker77222 жыл бұрын
Thank you! Great tutorial! Very good style. It is fun to watch! So professional, so inspiring!👍
@EyiBillion5 жыл бұрын
Thank you for the tutorial. it was mind blowing.
@gabrielchoimet66954 жыл бұрын
Thanks I love this without class and difficult code its perfect !
@TokyoEdTech4 жыл бұрын
Glad you liked it!
@benaronson24105 жыл бұрын
please help! in the main game loop, where we try to get the ball to move, i keep getting an error that says "instance of turtle has no 'dx' or 'dy' member." How do I fix this???
@CT-qy2up4 жыл бұрын
at 20:30 i can't get the ball to bonce off the top of the screen it just stays on the y coronet 290 what do i need to do
@nier-mage86694 жыл бұрын
having issues with sound on windows and the ball is just to fast for the paddle or whatever to keep up, what can I do to fix this.
@beter18384 жыл бұрын
you can change the speed of the ball in 'ball.dx = ?' and 'ball.dy = ?' its in the code where you created the ball i`ve set it to 0.3 and its working fine for me.
@el4f3104 жыл бұрын
@@beter1838 wow,thank very much man!
@el4f3104 жыл бұрын
thank you *
@punk1996155 жыл бұрын
So, I was having trouble with the paddles not showing up and I moved the following code, [while True wn.update] after the paddle codes and then it started working!
@aprameyakannan42915 жыл бұрын
same here
@jenaal-abbas3304 жыл бұрын
ohhhh so im gonna do that. thanks!
@dolphfps4 жыл бұрын
Instead of doing wasd, you can do the arrow keys, but you have to do capital letters, for example, Up, Down, Left, RIght.
@dolphfps4 жыл бұрын
@@TokyoEdTech :D you're we,come!
@enazzzz11 ай бұрын
he did use the arrow keys you just didn't watch through the whole video@@dolphfps
@dolphfps11 ай бұрын
that was 3 years ago-@@enazzzz
@enazzzz11 ай бұрын
lol i just saw the time srry@@dolphfps
@k.alipardhan69575 жыл бұрын
28:00 the giant if statement should be nested if statements, since they are a lot more readable and noob friendly
@viljar_53395 жыл бұрын
"raw_input" is not defined. Me: Well, that's because there is no "raw_input" in my code
@talhanawaz54865 жыл бұрын
U can use simple "input ( ) " either because raw_input is no longer supported in python 3
@EJStudios174 жыл бұрын
I noticed that false debug notices can appear if something isn’t completely true, say you said print(‘blah , text_q , blah blah’) And because you don’t put the ‘ after getting python to put input in.
@iamsatyam96894 жыл бұрын
@@TokyoEdTech thanks :)
@Glitch11254 жыл бұрын
I like my input cooked
@rohanyadav85734 жыл бұрын
hey I'm facing a bug, do you mind helping me out on this, "whenever the ball bounces from the corners it's speed increases for a fraction of time, and gets shot in the direction it's following... "
@saun_sa4 жыл бұрын
Looks like turtle module got some weird physics bruh
@notanamehere83554 жыл бұрын
Mine too but Ok
@tankytitan13044 жыл бұрын
Check your move the ball function
@av4654 жыл бұрын
It happened with me too but it was because i used + not * in the if cause
@xxjtoot87645 жыл бұрын
im trying to get the ball to move but an error pops up saying the ball is not defined even though im following along exactly
@dausband794 жыл бұрын
Building a Pong game This does put a smile on my face
@snatchbandicoot5 жыл бұрын
Just wondering... why do you like using 4 spaces instead of a tab? I have always used tab and the computer automatically puts a tab in certain situations, so why change it up?
@Set_Abominae5 жыл бұрын
It's because of the PEP8 of Python. Read about it.
@nathansmith36085 жыл бұрын
maybe it's because Developers Who Use Spaces Make More Money Than Those Who Use Tabs stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ half kidding; Python style guide recommends indents using 4 space chars, & Python's hot among data scientists & at Google, which I suspect explains the correlation they found
@johnniegilkerson47245 жыл бұрын
Im running this code in visual studio code on windows 10, everything works but the ball goes way too fast?
@leahr.5295 жыл бұрын
johnnie gilkerson try using points like 0.2
@k01b015 жыл бұрын
Mine also does not work. I tried every speed option and it goes the same fast speed.
@stolencinnamon62305 жыл бұрын
same here anyone knows why ?
@k01b015 жыл бұрын
@@stolencinnamon6230 You still having the problem?
@sevcandincel5 жыл бұрын
First sorry for bad english. johnnie gilkerson its cause of it is performance based move. İ mean, if your computer fast execute the while loop, your ball will move fatser. You should use velocity based moving. For this, you can use time function from time module. This function give time as seconds. So you can calculate how many seconds a loop will last. Then you should multiple this time with ball.dx and ball.dy.
@s.dh293 жыл бұрын
i was so happy when u said u werent using OOP, i cant get my head around it!
@SuperDavedm4 жыл бұрын
Great tutorial, I was wanting to make a more interesting version of pong and using this a base. How would you suggest dynamically updating the background as the game runs?
@harshitgupta54443 жыл бұрын
adding a controller control or mouse control maybe, simple yet good creativity
@nickw226895 жыл бұрын
Anyone who's built and run this, does the "spin" of the ball change depending on the velocity and placement of the paddles when the ball hits?
@alexshao99164 жыл бұрын
This version of pong has no spin specifically coded in. In the original game and more complex versions, that would be a feature to add, but this is just a basic overview on the general ideas of the game itself.
@kartavyabagga4 жыл бұрын
print("Cool Stuff Bro!!! I made my own changes in it Thanks for this tutorial it's very helpful...")
@TokyoEdTech4 жыл бұрын
Thanks - glad you liked it!
@374O3 жыл бұрын
@@TokyoEdTech wrong video Lmfao i just watched your space invader one
@CheatGang4 жыл бұрын
ima get back into coding starting today
@TokyoEdTech4 жыл бұрын
No time like the present!
@timmithytebow37724 жыл бұрын
I can’t get the paddle to go up when I press w
@yeesquad71964 жыл бұрын
i cant either
@Ledinos15 жыл бұрын
Great tut. I've been trying to improve the game by adding ball speed-up after every paddle hit but i cannot figure it out :/ Can someone help ?
@simonmoberg89065 жыл бұрын
Try playing around with where you have this (in the collision detection with paddles): Instead of: ball.dx() *= -1 do ball.dx() *= -2 This will invert the current direction and also double the speed. For me, I find the increase of 50% (1.5) be quite alright if you start quite slow. You'll need to reset the speed at the instant when you increase the score.
@josephreed32874 жыл бұрын
Simon Moberg yeah. I did the same thing but had to change it to *= 1.1 because it was a bit too fast to rally for long. Also make sure you reset the dx when you score. Or else it speeds up indefinitely. Lol
@simonmoberg89062 жыл бұрын
@Uzi the fish I'm sorry but I have forgotten about this stuff :(
@buddyruns144 жыл бұрын
even copy /pasting your code into pyCharm gives me the black window only, the paddle doesn't show up. Any idea why?
@gv67584 жыл бұрын
When I press and hold the keys that trigger the movement, they do the movement repeatedly as long as I'm holding the key, which is what I expect but, I don't know why, if I press and hold the key that triggers the down movement on the paddle b, it only does it one time. It's not a keyboard problem if anyone's wondering
@dotcom42044 жыл бұрын
so i tried to do the sound part but instead of the bounce.wav playing, i just got a windows error sound, which is just as good so im happy
@alimz31344 жыл бұрын
same i got that 2
@Ardeenio Жыл бұрын
Thanks to this tutorial, I accidentally made it so the ball jukes you out by going fast and slow. It's not a bug, it's a feature 😁
@davidross1332 Жыл бұрын
did you figure out why the ball actually goes slow sometimes? haha
@yamatanoorochi314911 ай бұрын
What's so different between your code and his? Mine does the same but there is no difference at all maybe it's the python version or your pc model? I'm using py 3.11 He mentioned in the vid that the ideal speed depends on the pc you have so maybe the variation in speed is also because of that
@TLgaming7372 жыл бұрын
awesome! thanks for the help. 😃
@TokyoEdTech2 жыл бұрын
You're welcome - keep on codin'!
@krishanujoarder29355 жыл бұрын
This one works fine. I have tried executing other game codes in KZfaq, it did not work. Awesome tutorial.
@climbingcreeper16094 жыл бұрын
The ball keeps changing speed... please help
@kindersmith84074 жыл бұрын
yeah it happens to me too, but it doesnt impact preformance......... i'lll just deal with it
@TheBerkaay3 жыл бұрын
Thank you for the tutorial. I found it very useful. I have a question though, when I try to move both paddles at the same time (giving the program two inputs simultaneously) the program gives priority to first input given. Is there any way to fix this? Or this is because the turtle library? I am saying this because in some games, mario for instance, you can jump but you can also jump to left or right by pushing 2 buttons at the same time. Thanks in advance.
@TokyoEdTech3 жыл бұрын
You're welcome. That is a limitation of the turtle module - try Pygame instead.
@annielouise11413 жыл бұрын
my ball is not moving....
@iudizm5 жыл бұрын
I made it... in 2 hours, but its awesome. Thx for all the wisdom hehe
@vampiriclion11764 жыл бұрын
I come from java and I'm shocked because of the simplicity of py. I began to study Python few days ago and I love it
@samuelmodig28163 жыл бұрын
Thank you for a great tutorial! So, how do I export this as a finished .exe game?
@gokulravi71335 жыл бұрын
Dude my ball speed at the game is really high.. After doing the same as u did.. How can i reduce it.. And keep it to a normal
@rafaelperezmederos69585 жыл бұрын
also have the same issue
@AdurxIsd5 жыл бұрын
dunno if you still have the problem, but reducing ball.dx and ball.dy to something like 0.2 insetad of 2 should help.
@jonastangen46015 жыл бұрын
i found a flaw where the game could not register, moving paddle a and b at the same time. only one of the would register once at a time.
@mishaan17915 жыл бұрын
was fun to do this thanks man
@cesag13295 жыл бұрын
28:49 my ball trespasses the paddle b :(
@ibrah1m4 жыл бұрын
were u able to fix this?
@randmorf4 жыл бұрын
If the top and bottom parts of your paddle seems not to work, it's because in the code for the ball colliding with the paddle uses +40 and -40 to delimit the paddle. The paddle is 100px tall, and the code above uses only the middle 80px. To make the full paddle workable, the code should use +50 and -50. This change will need to be made in two places (remember those two horribly long if statements? That's where.).
@carboncuber31474 жыл бұрын
When I ran the ball moving on my computer for the first time it yeeted itself off the screen.
@starclan23034 жыл бұрын
its a yeetball
@Gesso644 жыл бұрын
turn the speed down
@tess.cantthinkofaname29564 жыл бұрын
Yeah that happened to me I ended having to change the speed to 0.1
@Moomoocowmeoww5 жыл бұрын
Thank you for this practical presentation. Explained alot for me man. Appreciated
@tamassvecz571 Жыл бұрын
Very useful tutorial! Thank you very much from Hungary! 😊