[open] Moving Object
Dear all,
I am very new to OpenSesame and to Python programming - however, I would like to ask you for a little help regarding a target-interception task.
Basically, in my experiment I have some troubles creating a command for a circle popping up at the left edge of the screen (y=0) and moving to the right to the opposite edge. The trial ends as soon as the participants click with the left button of the mouse within or outside the circle. So far, I was able to create the circle but not having the circle in motion. Any clues?
Moreover, I have another question following the issue described above. Is there a way to set a time duration after the which the circle changes color? For example, the circle starts to move from left to right but after 200 ms (or when it reaches specific spatial coordinates) it becomes white instead of black.
Thanks in advance for your help.
Alessio
Comments
Hi Alessio,
You should think of a moving display as a series of frames. So what you would need to do is write an
inline_scriptin which acanvasis redrawn over and over, each time with a circle at a slightly different position. And at the same time, you need to continuously check whether a mouse button was pressed, and, if so, end the loop. Do you see what I mean? The script below shows the general idea, although you'll probably have to modify it a bit for your purpose. (For example, to include a color change.)You can find useful information here:
Good luck!
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!