Python: Pong Game

Source: Created by @networkingwizard

Over the last few weeks, I’ve been attempting to prepare myself to complete the 100 Days of Coding challenge which I will commit to later this year.
I feel it is important for me to learn the basics before undertaking the challenge. Not only will this help with having some understanding, it will reduce my frustration and struggle and make me less likely to quit.
For the most part, I have been using a course that I purchased on udemy. See course link here:

The Course itself, is designed to teach the basics in Python Programming for Networking and get you familiar with the concepts of Strings, Integers etc.I’m about a third of the way through the course now.
However, today I decided to deviate from the course entirely, and create a game.
After watching several game development videos on YouTube, I decided to create the ‘Pong’ Game from using Python Programming.
The video I watched to create this code can be found here:

As I followed the tutorial, I changed certain aspects of the code. What I mean by this, is that I’ve used my own variable names, and changed a few other settings, such as; The speed of the ball.
Overall, this proved to be beneficial as it aided with the learning process and helped me understand how the code works.
It did prove to be a bit of a headache at times though. At times, I would get the viable names mixed up. However, this was easily corrected. Getting the setting of the ball just right, took a fair amount of playing around. I found that when using the setting within the video, the ball flew off screen so quickly that the game would have been unplayable.
After a little bit of research, I found that setting the variable speed to 1/5 (Instead of 2, as specified in the tutorial, made the game run much smoother).

There were some really good pointers in the tutorial. It made sense to check the code after writing each section, this limits where the errors can be within the code. Therefore, making it easier to troubleshoot any problems that occurred. Also, reading what the error codes are and where the Integrated Development Environment (IDE) believes the errors are, drastically reduced the time it took to resolve the errors.

I’m happy with how my first trial turned out. Through the next few weeks, I will take breaks from the course and create the remaining games within the tutorial video. Next up, is the snake game. I’m really excited about this one, I used to play this game for hours back in the early 2000’s when I had a Nokia 3310.

Published by Daniel Wray

IT Support Engineer; Studying for CompTIA Network+. 100 Days of Python Challenge. Aspiring blogger. Passion for Learning and Teaching!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: