I’m new to PsychoPy (version 1.90.1, Builder view, Windows10) and Python and have trouble creating an experiment where I’d like to simultaneously present two components at first (a randomly selected text component and an image component) and then replace the image component with another image while keeping the text component presented until the routine is over. I’d greatly appreciate any support
In my experiment, I’d like participants to move a manikin on the screen toward (approach) or away from (avoidance) a randomly selected name from a list by pressing either the right or the left key (originally, I thought of using a joystick, but apparently, there might be some problems with that: http://www.psychopy.org/api/hardware/joystick.html ?). So the manikin should be centered at the beginning of each trial and then ‘move’ to the right or to the left according to participants’ keypress.
I’ve created bmp images of manikins in three different positions (centered = ManM, left = ManL, and right = ManR) to simulate manikin movement and an xlsx file containing the names in one column (header: ‘name’). In each trial, one of these names is presented with the names component.
I’ve also added two code components - one that randomly makes the names appear left or right (code):
if random()>0.5: targetPos=[-0.5, 0.0]#on the left else: targetPos=[+0.5, 0.0]#on the right
and one that enables respective presentation of either ManL or ManR according to participants’ key press (code_2):
ManL.tStart = 0 ManR.tStart = 0
if response.keys == 'left': ManL.setAutoDraw(True) ManR.setAutoDraw(False) win.flip() core.wait(1.0) elif response.keys == 'right': ManR.setAutoDraw(True) ManL.setAutoDraw(False) win.flip() core.wait(1.0)
So far, everything looks as expected except for the names which disappear after pressing one of the predefined keys (so one of the names is presented together with ManM, but as soon as either ManL or ManR appears, the name disappears).
I’ve tried to change the settings of ‘names’:
stop --> condition --> $ManL.status==FINISHED or ManR.status==FINISHED
but then the names didn’t show up at all.
Do you know what I could do to keep the names presented together with ManL/ ManR until the end of each trial1 routine?
I would be very grateful for any support - thank you so much!
ManM + one of the names:
ManL - name is missing:
namegame.psyexp (18.6 KB)