Skip to content

Commit

Permalink
req sound fx
Browse files Browse the repository at this point in the history
  • Loading branch information
Super-JoConnell committed Aug 10, 2021
1 parent fe1bb31 commit 9634ada
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion Game Of Pong.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
wn.setup(width=800, height=600)
wn.tracer(0)

# Score

score_1 = 0
score_a = 0



#Paddle L
paddle_l = turtle.Turtle()
Expand Down Expand Up @@ -40,6 +46,19 @@
ball.dx = 0.1
ball.dy = 0.1

# Pen

pen = turtle.Turtle()
pen.speed(0)
pen.color("white")
pen.penup()
pen.hideturtle()
pen.goto(0, 260)
#pen.write("Retard 1: 0 Retard A: 0", align="center", font=("Courier", 18, "bold"))
pen.write("Retard 1: {} Retard A: {}".format(score_1, score_a), align="center", font=("Courier", 18, "bold"))



#Functions
def paddle_l_up():
y=paddle_l.ycor()
Expand Down Expand Up @@ -96,11 +115,16 @@ def esc_shutdown():
if ball.xcor() > 390:
ball.goto(0, 0)
ball.dx = ball.dx * -1
score_1 = score_1 + 1
pen.clear()
pen.write("Retard 1: {} Retard A: {}".format(score_1, score_a), align="center", font=("Courier", 18, "bold"))

if ball.xcor() < -390:
ball.goto(0, 0)
ball.dx = ball.dx * -1

score_a = score_a +1
pen.clear()
pen.write("Retard 1: {} Retard A: {}".format(score_1, score_a), align="center", font=("Courier", 18, "bold"))

# Paddle Collision

Expand Down

0 comments on commit 9634ada

Please sign in to comment.