I need help I am trying to make a game called Pong which is very famous, I have practically created the ball and both paddle in code ... I have problems making the ball move constantly and bounce off the walls and on the paddle and on create a score .... according to the instructions I cannot use another library other than graphics.py .... and it shows me an error message ... here is my python code:
Need help with my python codee!!!
Fora Tror graphics import. ungoame.py 2 3 4 der paddleA up paddleA): paddlea.novele, -20) def paddles_down (paddler): paddleA.move(e, 2e) 6 7 8 9 1e 11 12 13 14 15 16 17 18 19 20 21 def paddles_up paddles): paddles.move(e, -20) def paddle_down (paddle): paddle.move(e, 20) def main(); Window vir - Graphitin("Pong Game", 600, 400) win.setBackground("black) Paddle paddle = Rectangle(Point(5,1), Point (10,70)) paddles.setOutline(White) paddle. setFill(white") paddles.drain) paddlel.move(s, 170) Paddles paddles - Rectangle(Point(5,1), Paint(1, 2)) paddles.setut Line White paddle. setFill(white) paddles.drain) paddle.move(S80, 170) Ball ball - CirclePoint(2, 2), 89 hall.setOutline("White") boll.setFill White ball.drawin) ball.move(20, 170) Usktop PongGame.p Dail.oraw(wan) ball.move(290, 170) dx = 1 dy = 1 paddles.draw(in) 1:52paddle.move(s, 170) | LIE #Paddles paddles - Rectangle(Point(5,1), Paint(3, 3)) paddle.setOutline Vite paddle. setFill vite paddles.dra) paddle.moveisa, 170) Ball ball - Circle(Point 120, 20), 39 boll.setOutlineWhite) boll.setFullwhite) ball.dravi) ball.move(299, 170) Desktop PongGame.p Dall.araw w203 ball.move(290, 170) dx = 1 dy = 1 #Move Paddle while True: key = win.checkKey() if key break elif key - "Up": paddle__up (paddles) elif key = "Down": paddles_down{paddle) elif key = "W": paddle8_up{paddles) elif key - "s": paddles_down{paddles) Move Ball for i in range(18808): ball.move() if ball.move() > 28: el LTE 1:52 dx = 1 dy = 1 if key #Move Paddle while True: key = win.checkKey() "o": break elif key "Up": paddlet_up(paddle) elif key = "Down": paddle__down{paddle) elif key "W": paddles_up{paddles) elif key = "s": paddleb_down{paddles) #Move Ball for i in range (18000): ball.move() if ball.novel) > 28: dx = -1 elif ball.move() 28: dy = -1 euf ball.move() 20: dx = -1 euf ball.move() 20: dy = -1 elif ball.move() 28: el LTE 1:52 dx = 1 dy = 1 if key #Move Paddle while True: key = win.checkKey() "o": break elif key "Up": paddlet_up(paddle) elif key = "Down": paddle__down{paddle) elif key "W": paddles_up{paddles) elif key = "s": paddleb_down{paddles) #Move Ball for i in range (18000): ball.move() if ball.novel) > 28: dx = -1 elif ball.move() 28: dy = -1 euf ball.move() 20: dx = -1 euf ball.move() 20: dy = -1 elif ball.move()