r/pythonhelp • • Feb 09 '20

Having a hard time getting python to understand my keys.

Post image
0 Upvotes

2 comments sorted by

3

u/samuelcbird Feb 09 '20

At the moment you’re trying to define paddle1_up1(): twice. Take the top one out.

There’s too much indentation in the body of the while loop. Also, are the listen and on key press methods meant to be in the game loop?

I’ve assumed listen is a method which would mean it’s missing it’s parenthesis (). And also in the on key press method you have two arguments and they need to be separated by a comma:

 wn.onkeypress(paddle1_up, “w”)

Hope i’ve managed to help. Good luck!