Hi there. I’m trying to randomly rotate stimuli clockwise and counterclockwise in a Builder experiment. This is what I have in my code component:
**Begin Experiment
imPositions = [(-.35, 0), (.35, 0)]
shuffle(imPositions) # to randomize first position
Image1P.setPos(imPositions[0])
Image2P.setPos(imPositions[1])
imDirection = [1,-1] # to randomize rotation direction
**Begin Routine
Image1P.setPos(imPositions[0])
Image2P.setPos(imPositions[1])
shuffle(imPositions) # to randomize position
shuffle(imDirection)
currentOri = 0
**Each Frame
if Image1P.ori < 180:
Image1P.ori += 1
currentOri = Image1P.ori
if abs(currentOri) < 180:
Image1P.ori += imDirection[0]
print('direction',imDirection[0])
print('orientation',Image1P.ori)
I get this but when I run the experiment, the stim only rotate clockwise. Either there is something missing in the code and I’m just not seeing it, or there’s a bug? Any help is appreciated!