In my experiment I have an image presented in a position initially set by a variable in the Excel conditions file. Each frame, if the participant clicks the mouse then the position of the image will update and when the space bar is pressed the routine ends and a different image will be presented in a different starting position.
This works fine offline on Psychopy but when I go through the experiment in Pavlovia before going to its set starting position each image will flicker in the last position of the image in the previous loop.
The code for each frame is included below:
if mouse.isPressedIn(Cshape) and mouse.getPressed()[0] == 1:
deg = (deg + 2)
posX = Eccentricityobj * cos((pi/180) *(deg))
posY = Eccentricityobj * sin((pi/180) *(deg))
first_obj_1.setPos([posX,posY])
if mouse.isPressedIn(Cshape) and mouse.getPressed()[2] == 1:
deg = (deg - 2)
posX = Eccentricityobj * cos((pi/180) *(deg))
posY = Eccentricityobj * sin((pi/180) *(deg))
first_obj_1.setPos([posX,posY])
The starting position in builder is set to update every repeat and is ([obj1posx,obj1posy]) which links to the conditions file.