Description of the problem:
In my experiment I have created a list of circles and another list of letters which are located the center of related circles. What I need to do is to determine the order in the list of circle which clicked by mouse and set both circle’s and related letter’s positions at the same time. I have used below code:
#there will be 26 circles and letters list1 = [circleA, circleB] list2 = [textA, textB] # mouse movement for objects in the list for obj in list1: listCount = list1.index(obj) if mouse.isPressedIn(obj, buttons=) and objectCount == 0: objectCount += 1; if objectCount == 1 and mouse.getPressed() == False: objectCount -= 1; elif objectCount == 1 or mouse.getPressed(): x, y = mouse.getPos() obj.setPos((x, y), log=False) list2[listCount].setPos((x, y), log=False);
that code works in PschoPy perfect but when I try to run it at Pavlovia, I get " list1.index is not a function" error. As far as my little experience in PsychoPy and Pavlovia, there should be a discrepancy between Python and JS.
Do I need to use another command instead of “.index”?