Active1 year, 4 months ago
Nov 10, 2013 Mini-project #4 - 'Pong' In this project, we will build a version of Pong, one of the first arcade video games (1972).While Pong is not particularly exciting compared to today's video games, Pong is relatively simple to build and provides a nice opportunity to work on the skills that you will need to build a game like Asteroids.As usual, we have provided a program template that can be used to. I'm trying to code a machine learning version of pong in python. So far, all I have is the game without any AI. I personally have very little experience with Python and coding in general, so any feedback would really help!
Being able to program Pong is a doorway to being able to program a lot of other games. However once you start playing Pong you might find less time to program, as it is quite addictive! We are going to program pong using Python and Pygame. I will be using Python 2.7. For those programming on a Raspberry Pi this will already be installed. We will be making a Pong game using Python, and the Tkinter module. Tkinter is nativity include in most Python code editors, and this code will run in with both Windows and Linux. Classic Pong game in Python - using pygame. GitHub Gist: instantly share code, notes, and snippets.
$begingroup$I'm trying to code a machine learning version of pong in python. So far, all I have is the game without any AI.
I personally have very little experience with Python and coding in general, so any feedback would really help! If possible, I'd like to know what the common best practices are when working on a project like this and to what degree I am complying with those practices.
Anyway, here is the code:
Mast7,97277 gold badges3939 silver badges9393 bronze badges
TJenkinsTJenkins
$endgroup$1 Answer
$begingroup$Pong Game Python Code
First of all, welcome to CodeReview!
I'd like to know what the common best practices are when working on a project
- namingRocksmith 2014 Free Download PC Game Cracked in Direct Link and Torrent. Rocksmith 2014 is the fastest way to learn guitar. Rocksmith 2014 is developed by Ubisoft – San Francisco and published by Ubisoft. It was released in 24 Oct, 2013. Rocksmith 2014 Edition is the fastest way to learn guitar. Rocksmith 2014 iso torrent.It has been mentioned in the comments by @mast, naming is a very important part of coding. Would you still understand this code after a hiatus of a few months? I have a hard time understanding the code as is. I would have been able to give a better review if your code was more readable. Good code should be readable at first glance, the below variables have no meaning for me..
- Divide code into more functions/classes!You say you want to make it run by an AI.. as is, your code would require a heck of a rewrite. But if you would have divided your code into more functions, the AI can reuse a lot of the functions you created for a single player game, and thus making your code easier to maintain, or add functionality.What functions/classes should a game of pong have? Boot efi usb windows 10.
- a Player (class) <-- This player class can be used by both Players.
- a Pong enviroment (class)
Using a structure like this will improve the code alot, and adding an AI (or other improvements will be easier after this) - Avoid working in the global namespaceThis point is interwoven with dividing the code into functions/classes, see this link as to WHY working in the global namespace is considered bad.
- Wrap up your code into a
if __name__ '__main__':
guard.This will make your code be runnable from the command line, while also be able to be imported into other scripts
![Pong Pong](/uploads/1/3/7/4/137403152/397727146.jpg)
Basic Pong Game Python Code Pdf
9,36322 gold badges2727 silver badges7171 bronze badges