Is there a way to move an object continuously across the screen while holding down a key that will also work online on Pavlovia?
At the moment I have the following code which requires that you keep pressing the key - it won’t keep moving the object if you hold down the key. In my task the participant will be reporting the location of an object positioned around a circle. ‘obj1posX’ and ‘obj1posY’ are the position variables set in the task builder to refresh each frame.
I have been able to get this working using pyglet but cannot use that on Pavlovia.
keys = event.getKeys() if keys: if 'left' in keys: deg = deg + 1 obj1posX = Eccentricity * cos(math.radians(deg)) obj1posY = Eccentricity * sin(math.radians(deg)) if 'right' in keys: deg = deg -1 obj1posX = Eccentricity * cos(math.radians(deg)) obj1posY = Eccentricity * sin(math.radians(deg))