Ping Pong
Python Game
A nostolgic game created in Python. Reference: github.com/bantezana/PingPong
In order to inhance my abilities in Python, In this small project I decided to create an old school game called Ping Pong using Turtle, an API(Application Program Interface) than can shape and design structures in Python.
Snippet of Python Code
import turtle
wd = turtle.Screen()
wd.title("Ping Pong")
wd.bgcolor("black")
wd.setup(width=800, height=600)
wd.tracer(0)
#score
score1 = 0
score2 = 0
#player 1
player1 = turtle.Turtle()
player1.speed(0)
player1.shape("square")
player1.color("white")
player1.shapesize(stretch_wid=5, stretch_len=1)
player1.penup()
player1.goto(-350, 0)
#player 2
player2 = turtle.Turtle()
player2.speed(0)
player2.shape("square")
player2.color("white")
player2.shapesize(stretch_wid=5, stretch_len=1)
player2.penup()
player2.goto(350, 0)
#ball
ball = turtle.Turtle()
ball.speed(0)
ball.shape("square")
ball.color("white")
ball.penup()
ball.goto(0, 0)
I have also created for 2 players to play in a game with score and and border functionalities.