I am working on a task where a participants use a net (which is dragged on screen by making it contingent with the mouse) to search for a hidden coin.
It is all functional but I’m looking to make the net change colour based upon the size of the error made by participants.
I am defining the error as the difference between the target’s actual position and the mouse position (x only) using code like this:
difference = target_coin.pos[trials.thisRepN] - mouse.getPos()[0]
if difference[trials.thisRepN] < 0.07:
net_feedback.color = "green"
else:
net_feedback.color = "white"
But what it seems to be doing is turning green when it isn’t meant to (when the error made by the participant is very large). I think the issue I am having is specifying my target position on a specific trial. I thought the code for this was:
target_coin.pos[trials.thisRepN]
However, I think I need to refer to only the x co-ordinate. How would I do this? I tried matching this up to the heading I have for the coin position in the conditions file but it treats the positions as a float and not a list.