I hope you took away lots from this video. Let me know below! PS: I'm creating an OOP course! Sign up at programmingwithnick.com/course for early access and a 50% launch discount.
Thanks Tim for the feedback and the support. It took me a lot of time to prepare this video because I am learning how to create animations at the same time, but as I get better to it I will post more often. I was not around when Pong was released but I remember playing it when I was a kid. Now a teenager can program it in an hour. How things have changed..
Pretty good. Would like the game loop to look a bit smaller...dole out more functions. Try to put the event code in it's own function, but then the user paddle wouldn't work....
idk if anyone else has this error, but when i type ball = pygame.rect i get a error that there is no callback. The game screen pops up for a half a second then goes away. After a couple hours of debugging its because you must type in ball = pygame.Rect because you have to access the upper level of the module while lower case r accesses the lower level. solved the problem. hope this helps others
hi i have a problem when the bot move down the screen he keeps disspeare and the player glitch on the corner of the screen and the ball sometimes start moving glitchy
Hi, thank you for sharing, but when I tried the code, it wis working when I touched to the mouseor pres to the space, it is not working itself like yours,do you know why?
There are many ways to do it. One simple way is to reduce the speed of the cpu paddle, or increase the speed of the ball. Another way is to move the cpu paddle only if it has reached the middle of the screen in the x axis and so on. Use your imagination.
I hope you took away lots from this video. Let me know below!
PS: I'm creating an OOP course! Sign up at programmingwithnick.com/course for early access and a 50% launch discount.
Beautifully explained. Thank you!
Thanks prof! Great explained! You are top!
Thanks so much! Great video and well explained.
Fantastic Nick.
I remember when pong came out to play on the TV, haha. I think I prefer the square ball ;)
Thanks Tim for the feedback and the support. It took me a lot of time to prepare this video because I am learning how to create animations at the same time, but as I get better to it I will post more often.
I was not around when Pong was released but I remember playing it when I was a kid. Now a teenager can program it in an hour. How things have changed..
Thank you! this was so much fun
Thanks for the video. Can I please access the Pygame cheatsheet.
Pretty good. Would like the game loop to look a bit smaller...dole out more functions. Try to put the event code in it's own function, but then the user paddle wouldn't work....
idk if anyone else has this error, but when i type ball = pygame.rect i get a error that there is no callback. The game screen pops up for a half a second then goes away. After a couple hours of debugging its because you must type in ball = pygame.Rect because you have to access the upper level of the module while lower case r accesses the lower level. solved the problem. hope this helps others
python is casesensitiv please use: ball = pygame.Rect ....
pygame.Rect is a function to set the rectangle
Respect Sir
hi i have a problem when the bot move down the screen he keeps disspeare and the player glitch on the corner of the screen and the ball sometimes start moving glitchy
Hi, thank you for sharing, but when I tried the code, it wis working when I touched to the mouseor pres to the space, it is not working itself like yours,do you know why?
Thanks
Thanks Nick
Hi Nick, thanks - very well explained.
Do you have any idea how we can change the AI so that the player has a chance of winning a point?
There are many ways to do it. One simple way is to reduce the speed of the cpu paddle, or increase the speed of the ball. Another way is to move the cpu paddle only if it has reached the middle of the screen in the x axis and so on. Use your imagination.
If screen_width and height are constants, shouldn't they be with capital letters?