I’m working on a psychophysics task which requires participants to click on a moving ball as it passes behind an occluder (each trial ends when the ball is either clicked or reaches the other side of the screen). Even if participants miss, their accuracy is calculated by measuring the distance between their mouse click and the location of the ball at that time.
However, the accuracy values are not always appearing in the data output and my colleague and I think the problem lies in the following piece of code:
if mouse.getPressed()[0]:
textvalue3=str((sqrt(((mouse.x-xLoc)**2)+((mouse.y-yLoc)**2)))*100)
if firstClick ==10000:
firstClick=(sqrt(((mouse.x-xLoc)**2)+((mouse.y-yLoc)**2)))*100
When working on the task, we set textvalue3 to our accuracy calculation so that we could compare the accuracies recorded during trials with the accuracies we later observed in our data output. firstClick has been set to 10000 for now.
Any help would be greatly appreciated.