How do I get my pong paddle to move in CodeSkulptor

161 Views Asked by At

We are beginning to start a pong style game in my programming class. The problem that I am having with my code is that i cannot get the paddle to move. I am just starting so that's as far as I have gotten. I was wondering if anyone could spot my errors and explain what i did wrong? Thank You

Here is the link https://py3.codeskulptor.org/#user303_EVYDLScC0RseL2V_3.py

1

There are 1 best solutions below

0
On

You have to use a key event handler and change position of the paddle in the handler function. See "Control Objects" in the SimpleGUI documentation: https://py3.codeskulptor.org/docs.html

Here an improved version of your code, to beginning: https://py3.codeskulptor.org/#user303_EVYDLScC0RseL2V_5.py

You can see differences here: http://www.mergely.com/rC0yM2ng/

Be careful that the symbol = is not an equality test, it is for assignation. For equality use ==.

Note that a better place to ask this kind of question is the official forum of the MOOC. ;-) An Introduction to Interactive Programming in Python: https://www.coursera.org/learn/interactive-python-1